Skip to content

Commit

Permalink
rustc_errors: fix inaccurate comment
Browse files Browse the repository at this point in the history
  • Loading branch information
GrigorenkoPV committed Jul 31, 2024
1 parent bde59d0 commit 03906c5
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2607,9 +2607,9 @@ const OUTPUT_REPLACEMENTS: phf::Map<char, &'static str> = phf::phf_map![
];

fn normalize_whitespace(s: &str) -> String {
// Scan the input string for a character in the ordered table above. If it's present, replace
// it with it's alternative string (it can be more than 1 char!). Otherwise, retain the input
// char. At the end, allocate all chars into a string in one operation.
// Scan the input string for a character in the replacement table above.
// If it's present, replace it with its alternative string (it can be more than 1 char!).
// Otherwise, retain the input char.
s.chars().fold(String::with_capacity(s.len()), |mut s, c| {
match OUTPUT_REPLACEMENTS.get(&c) {
Some(r) => s.push_str(r),
Expand Down

0 comments on commit 03906c5

Please sign in to comment.