Skip to content

Commit 7cbf31a

Browse files
rename check-theme option into check-themes
1 parent bbfd63c commit 7cbf31a

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

src/librustdoc/config.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -282,12 +282,12 @@ impl Options {
282282
// check for deprecated options
283283
check_deprecated_options(&matches, &diag);
284284

285-
let to_check = matches.opt_strs("check-theme");
285+
let to_check = matches.opt_strs("check-themes");
286286
if !to_check.is_empty() {
287287
let paths = theme::load_css_paths(static_files::themes::LIGHT.as_bytes());
288288
let mut errors = 0;
289289

290-
println!("rustdoc: [check-theme] Starting tests! (Ignoring all other arguments)");
290+
println!("rustdoc: [check-themes] Starting tests! (Ignoring all other arguments)");
291291
for theme_file in to_check.iter() {
292292
print!(" - Checking \"{}\"...", theme_file);
293293
let (success, differences) = theme::test_theme_against(theme_file, &paths, &diag);
@@ -384,7 +384,7 @@ impl Options {
384384
default theme", theme_s))
385385
.warn("the theme may appear incorrect when loaded")
386386
.help(&format!("to see what rules are missing, call `rustdoc \
387-
--check-theme \"{}\"`", theme_s))
387+
--check-themes \"{}\"`", theme_s))
388388
.emit();
389389
}
390390
themes.push(theme_file);

src/librustdoc/html/render.rs

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ function handleThemeButtonsBlur(e) {{
635635
636636
themePicker.onclick = switchThemeButtonState;
637637
themePicker.onblur = handleThemeButtonsBlur;
638-
[{}].forEach(function(item) {{
638+
{}.forEach(function(item) {{
639639
var but = document.createElement('button');
640640
but.innerHTML = item;
641641
but.onclick = function(el) {{
@@ -644,10 +644,7 @@ themePicker.onblur = handleThemeButtonsBlur;
644644
but.onblur = handleThemeButtonsBlur;
645645
themes.appendChild(but);
646646
}});"#,
647-
themes.iter()
648-
.map(|s| format!("\"{}\"", s.replace("\\", "\\\\").replace("\"", "\\\"")))
649-
.collect::<Vec<String>>()
650-
.join(","));
647+
as_json(&themes));
651648
write(cx.dst.join(&format!("theme{}.js", cx.shared.resource_suffix)),
652649
theme_js.as_bytes()
653650
)?;

src/librustdoc/html/static_files.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ pub static RUST_FAVICON: &'static [u8] = include_bytes!("static/favicon.ico");
5959
/// The built-in themes given to every documentation site.
6060
pub mod themes {
6161
/// The "light" theme, selected by default when no setting is available. Used as the basis for
62-
/// the `--check-theme` functionality.
62+
/// the `--check-themes` functionality.
6363
pub static LIGHT: &'static str = include_str!("static/themes/light.css");
6464

6565
/// The "dark" theme.

src/librustdoc/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,8 +256,8 @@ fn opts() -> Vec<RustcOptGroup> {
256256
"additional themes which will be added to the generated docs",
257257
"FILES")
258258
}),
259-
stable("check-theme", |o| {
260-
o.optmulti("", "check-theme",
259+
stable("check-themes", |o| {
260+
o.optmulti("", "check-themes",
261261
"check if given theme is valid",
262262
"FILES")
263263
}),

src/tools/rustdoc-themes/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ fn main() {
3939
exit(1);
4040
}
4141
let status = Command::new(rustdoc_bin)
42-
.args(&["-Z", "unstable-options", "--check-theme"])
42+
.args(&["-Z", "unstable-options", "--check-themes"])
4343
.args(&themes)
4444
.status()
4545
.expect("failed to execute child");

0 commit comments

Comments
 (0)