From 2c25ae28389b775d27aca77913d671849526bf35 Mon Sep 17 00:00:00 2001 From: Andrew Liebenow Date: Tue, 24 Sep 2024 19:56:50 -0500 Subject: [PATCH] Fix spelling exception comment --- src/uu/base32/src/base_common.rs | 19 ++++++++++--------- src/uucore/src/lib/features/encoding.rs | 3 ++- 2 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/uu/base32/src/base_common.rs b/src/uu/base32/src/base_common.rs index 9a56d1316..53f507e0d 100644 --- a/src/uu/base32/src/base_common.rs +++ b/src/uu/base32/src/base_common.rs @@ -740,16 +740,17 @@ fn format_read_error(kind: ErrorKind) -> String { let kind_string = kind.to_string(); // e.g. "is a directory" -> "Is a directory" - let kind_string_capitalized = kind_string - .char_indices() - .map(|(index, character)| { - if index == 0 { - character.to_uppercase().collect::() - } else { - character.to_string() + let mut kind_string_capitalized = String::with_capacity(kind_string.len()); + + for (index, ch) in kind_string.char_indices() { + if index == 0 { + for cha in ch.to_uppercase() { + kind_string_capitalized.push(cha); } - }) - .collect::(); + } else { + kind_string_capitalized.push(ch); + } + } format!("read error: {kind_string_capitalized}") } diff --git a/src/uucore/src/lib/features/encoding.rs b/src/uucore/src/lib/features/encoding.rs index b213da007..b27d3a1f9 100644 --- a/src/uucore/src/lib/features/encoding.rs +++ b/src/uucore/src/lib/features/encoding.rs @@ -3,7 +3,8 @@ // For the full copyright and license information, please view the LICENSE // file that was distributed with this source code. -// spell-checker:ignore (encodings) lsbf msbf unpadded +// spell-checker:ignore (encodings) lsbf msbf +// spell-checker:ignore unpadded use crate::error::{UResult, USimpleError}; use data_encoding::Encoding;