summaryrefslogtreecommitdiffstats
path: root/src/librustdoc/config.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/librustdoc/config.rs')
-rw-r--r--src/librustdoc/config.rs26
1 files changed, 12 insertions, 14 deletions
diff --git a/src/librustdoc/config.rs b/src/librustdoc/config.rs
index 217f1a6ee..81fb13f41 100644
--- a/src/librustdoc/config.rs
+++ b/src/librustdoc/config.rs
@@ -50,7 +50,7 @@ impl TryFrom<&str> for OutputFormat {
match value {
"json" => Ok(OutputFormat::Json),
"html" => Ok(OutputFormat::Html),
- _ => Err(format!("unknown output format `{}`", value)),
+ _ => Err(format!("unknown output format `{value}`")),
}
}
}
@@ -383,7 +383,7 @@ impl Options {
match kind.parse() {
Ok(kind) => emit.push(kind),
Err(()) => {
- diag.err(format!("unrecognized emission type: {}", kind));
+ diag.err(format!("unrecognized emission type: {kind}"));
return Err(1);
}
}
@@ -415,7 +415,7 @@ impl Options {
println!("rustdoc: [check-theme] Starting tests! (Ignoring all other arguments)");
for theme_file in to_check.iter() {
- print!(" - Checking \"{}\"...", theme_file);
+ print!(" - Checking \"{theme_file}\"...");
let (success, differences) = theme::test_theme_against(theme_file, &paths, &diag);
if !differences.is_empty() || !success {
println!(" FAILED");
@@ -556,30 +556,28 @@ impl Options {
matches.opt_strs("theme").iter().map(|s| (PathBuf::from(&s), s.to_owned()))
{
if !theme_file.is_file() {
- diag.struct_err(format!("invalid argument: \"{}\"", theme_s))
+ diag.struct_err(format!("invalid argument: \"{theme_s}\""))
.help("arguments to --theme must be files")
.emit();
return Err(1);
}
if theme_file.extension() != Some(OsStr::new("css")) {
- diag.struct_err(format!("invalid argument: \"{}\"", theme_s))
+ diag.struct_err(format!("invalid argument: \"{theme_s}\""))
.help("arguments to --theme must have a .css extension")
.emit();
return Err(1);
}
let (success, ret) = theme::test_theme_against(&theme_file, &paths, &diag);
if !success {
- diag.struct_err(format!("error loading theme file: \"{}\"", theme_s)).emit();
+ diag.struct_err(format!("error loading theme file: \"{theme_s}\"")).emit();
return Err(1);
} else if !ret.is_empty() {
diag.struct_warn(format!(
- "theme file \"{}\" is missing CSS rules from the default theme",
- theme_s
+ "theme file \"{theme_s}\" is missing CSS rules from the default theme",
))
.warn("the theme may appear incorrect when loaded")
.help(format!(
- "to see what rules are missing, call `rustdoc --check-theme \"{}\"`",
- theme_s
+ "to see what rules are missing, call `rustdoc --check-theme \"{theme_s}\"`",
))
.emit();
}
@@ -608,7 +606,7 @@ impl Options {
match matches.opt_str("r").as_deref() {
Some("rust") | None => {}
Some(s) => {
- diag.struct_err(format!("unknown input format: {}", s)).emit();
+ diag.struct_err(format!("unknown input format: {s}")).emit();
return Err(1);
}
}
@@ -628,7 +626,7 @@ impl Options {
let crate_types = match parse_crate_types_from_list(matches.opt_strs("crate-type")) {
Ok(types) => types,
Err(e) => {
- diag.struct_err(format!("unknown crate type: {}", e)).emit();
+ diag.struct_err(format!("unknown crate type: {e}")).emit();
return Err(1);
}
};
@@ -787,7 +785,7 @@ fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Han
for &flag in deprecated_flags.iter() {
if matches.opt_present(flag) {
- diag.struct_warn(format!("the `{}` flag is deprecated", flag))
+ diag.struct_warn(format!("the `{flag}` flag is deprecated"))
.note(
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",
@@ -800,7 +798,7 @@ fn check_deprecated_options(matches: &getopts::Matches, diag: &rustc_errors::Han
for &flag in removed_flags.iter() {
if matches.opt_present(flag) {
- let mut err = diag.struct_warn(format!("the `{}` flag no longer functions", flag));
+ let mut err = diag.struct_warn(format!("the `{flag}` flag no longer functions"));
err.note(
"see issue #44136 <https://github.com/rust-lang/rust/issues/44136> \
for more information",