From 4108ac4b3f7f1d3ff2550856b5893140f9197644 Mon Sep 17 00:00:00 2001 From: Pavel Grigorenko Date: Thu, 1 Aug 2024 01:02:25 +0300 Subject: [PATCH] rustc_errors: fix inaccurate comment --- compiler/rustc_errors/src/emitter.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index f632f518682a9..a4609e03bceef 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -2612,9 +2612,9 @@ const OUTPUT_REPLACEMENTS: phf::Map = 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),