Skip to content

Commit c45a553

Browse files
rename check-theme option into check-themes
1 parent b65a369 commit c45a553

File tree

5 files changed

+9
-12
lines changed

5 files changed

+9
-12
lines changed

src/librustdoc/config.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -280,12 +280,12 @@ impl Options {
280280
// check for deprecated options
281281
check_deprecated_options(&matches, &diag);
282282

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

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

src/librustdoc/html/render.rs

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

src/librustdoc/html/static_files.rs

+1-1
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

+2-2
Original file line numberDiff line numberDiff line change
@@ -252,8 +252,8 @@ fn opts() -> Vec<RustcOptGroup> {
252252
"additional themes which will be added to the generated docs",
253253
"FILES")
254254
}),
255-
stable("check-theme", |o| {
256-
o.optmulti("", "check-theme",
255+
stable("check-themes", |o| {
256+
o.optmulti("", "check-themes",
257257
"check if given theme is valid",
258258
"FILES")
259259
}),

src/tools/rustdoc-themes/main.rs

+1-1
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)