diff options
| author | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-15 22:44:51 +0100 |
|---|---|---|
| committer | Matthias Krüger <matthias.krueger@famsik.de> | 2023-02-15 22:54:57 +0100 |
| commit | 0400c685176200aabbcd9f615a950805bb61cf33 (patch) | |
| tree | 4cd2f07ee88942a10010311f0b31edbec4faceab | |
| parent | 2d14db321b043ffc579a7461464c88d7e3f54f83 (diff) | |
| download | rust-0400c685176200aabbcd9f615a950805bb61cf33.tar.gz rust-0400c685176200aabbcd9f615a950805bb61cf33.zip | |
use chars instead of strings where applicable
| -rw-r--r-- | compiler/rustc_resolve/src/rustdoc.rs | 2 | ||||
| -rw-r--r-- | src/librustdoc/html/format.rs | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_resolve/src/rustdoc.rs b/compiler/rustc_resolve/src/rustdoc.rs index a967f4b940c..3425e24585c 100644 --- a/compiler/rustc_resolve/src/rustdoc.rs +++ b/compiler/rustc_resolve/src/rustdoc.rs @@ -344,7 +344,7 @@ fn preprocess_link(link: &str) -> String { let link = link.strip_suffix("()").unwrap_or(link); let link = link.strip_suffix("{}").unwrap_or(link); let link = link.strip_suffix("[]").unwrap_or(link); - let link = if link != "!" { link.strip_suffix("!").unwrap_or(link) } else { link }; + let link = if link != "!" { link.strip_suffix('!').unwrap_or(link) } else { link }; strip_generics_from_path(link).unwrap_or_else(|_| link.to_string()) } diff --git a/src/librustdoc/html/format.rs b/src/librustdoc/html/format.rs index 314f0612249..4b73a53b8d9 100644 --- a/src/librustdoc/html/format.rs +++ b/src/librustdoc/html/format.rs @@ -361,7 +361,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>( for _ in 0..padding_amout { br_with_padding.push_str(" "); } - let where_preds = where_preds.to_string().replace("\n", &br_with_padding); + let where_preds = where_preds.to_string().replace('\n', &br_with_padding); if ending == Ending::Newline { let mut clause = " ".repeat(indent.saturating_sub(1)); @@ -1421,12 +1421,12 @@ impl clean::FnDecl { format!( "({pad}{args}{close}){arrow}", pad = if self.inputs.values.is_empty() { "" } else { &full_pad }, - args = args.replace("\n", &full_pad), + args = args.replace('\n', &full_pad), close = close_pad, arrow = arrow ) } else { - format!("({args}){arrow}", args = args.replace("\n", " "), arrow = arrow) + format!("({args}){arrow}", args = args.replace('\n', " "), arrow = arrow) }; write!(f, "{}", output) |
