about summary refs log tree commit diff
path: root/compiler/rustc_driver
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2021-12-13 22:58:58 +0100
committerMatthias Krüger <matthias.krueger@famsik.de>2021-12-14 12:40:28 +0100
commit97e844a032c47d4b3e70d2043f809767e437ac24 (patch)
tree6f1fc68faba406c3525cdc884b8cc211a5c54eae /compiler/rustc_driver
parent1796de7bb123df3f3d32124ededf1344434f672e (diff)
downloadrust-97e844a032c47d4b3e70d2043f809767e437ac24.tar.gz
rust-97e844a032c47d4b3e70d2043f809767e437ac24.zip
fix clippy::single_char_pattern perf findings
Diffstat (limited to 'compiler/rustc_driver')
-rw-r--r--compiler/rustc_driver/src/lib.rs10
1 files changed, 5 insertions, 5 deletions
diff --git a/compiler/rustc_driver/src/lib.rs b/compiler/rustc_driver/src/lib.rs
index 6ff94341142..12e0b7a4977 100644
--- a/compiler/rustc_driver/src/lib.rs
+++ b/compiler/rustc_driver/src/lib.rs
@@ -872,7 +872,7 @@ Available lint options:
 
     let print_lints = |lints: Vec<&Lint>| {
         for lint in lints {
-            let name = lint.name_lower().replace("_", "-");
+            let name = lint.name_lower().replace('_', "-");
             println!(
                 "    {}  {:7.7}  {}",
                 padded(&name),
@@ -908,10 +908,10 @@ Available lint options:
 
     let print_lint_groups = |lints: Vec<(&'static str, Vec<LintId>)>| {
         for (name, to) in lints {
-            let name = name.to_lowercase().replace("_", "-");
+            let name = name.to_lowercase().replace('_', "-");
             let desc = to
                 .into_iter()
-                .map(|x| x.to_string().replace("_", "-"))
+                .map(|x| x.to_string().replace('_', "-"))
                 .collect::<Vec<String>>()
                 .join(", ");
             println!("    {}  {}", padded(&name), desc);
@@ -960,7 +960,7 @@ fn print_flag_list<T>(
         println!(
             "    {} {:>width$}=val -- {}",
             cmdline_opt,
-            name.replace("_", "-"),
+            name.replace('_', "-"),
             desc,
             width = max_len
         );
@@ -1015,7 +1015,7 @@ pub fn handle_options(args: &[String]) -> Option<getopts::Matches> {
                 .iter()
                 .map(|&(name, ..)| ('C', name))
                 .chain(DB_OPTIONS.iter().map(|&(name, ..)| ('Z', name)))
-                .find(|&(_, name)| *opt == name.replace("_", "-"))
+                .find(|&(_, name)| *opt == name.replace('_', "-"))
                 .map(|(flag, _)| format!("{}. Did you mean `-{} {}`?", e, flag, opt)),
             _ => None,
         };