Skip to content

Commit 09a2267

Browse files
authored
Rollup merge of rust-lang#108099 - matthiaskrgr:str_to_char, r=GuillaumeGomez
use chars instead of strings where applicable
2 parents 2dc21c0 + 0400c68 commit 09a2267

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

compiler/rustc_resolve/src/rustdoc.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,7 @@ fn preprocess_link(link: &str) -> String {
344344
let link = link.strip_suffix("()").unwrap_or(link);
345345
let link = link.strip_suffix("{}").unwrap_or(link);
346346
let link = link.strip_suffix("[]").unwrap_or(link);
347-
let link = if link != "!" { link.strip_suffix("!").unwrap_or(link) } else { link };
347+
let link = if link != "!" { link.strip_suffix('!').unwrap_or(link) } else { link };
348348
strip_generics_from_path(link).unwrap_or_else(|_| link.to_string())
349349
}
350350

src/librustdoc/html/format.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -361,7 +361,7 @@ pub(crate) fn print_where_clause<'a, 'tcx: 'a>(
361361
for _ in 0..padding_amout {
362362
br_with_padding.push_str(" ");
363363
}
364-
let where_preds = where_preds.to_string().replace("\n", &br_with_padding);
364+
let where_preds = where_preds.to_string().replace('\n', &br_with_padding);
365365

366366
if ending == Ending::Newline {
367367
let mut clause = " ".repeat(indent.saturating_sub(1));
@@ -1419,12 +1419,12 @@ impl clean::FnDecl {
14191419
format!(
14201420
"({pad}{args}{close}){arrow}",
14211421
pad = if self.inputs.values.is_empty() { "" } else { &full_pad },
1422-
args = args.replace("\n", &full_pad),
1422+
args = args.replace('\n', &full_pad),
14231423
close = close_pad,
14241424
arrow = arrow
14251425
)
14261426
} else {
1427-
format!("({args}){arrow}", args = args.replace("\n", " "), arrow = arrow)
1427+
format!("({args}){arrow}", args = args.replace('\n', " "), arrow = arrow)
14281428
};
14291429

14301430
write!(f, "{}", output)

0 commit comments

Comments
 (0)