mirror of
https://github.com/uutils/coreutils
synced 2024-12-13 06:42:42 +00:00
Fix spelling exception comment
This commit is contained in:
parent
70c3f49430
commit
2c25ae2838
2 changed files with 12 additions and 10 deletions
|
@ -740,16 +740,17 @@ fn format_read_error(kind: ErrorKind) -> String {
|
||||||
let kind_string = kind.to_string();
|
let kind_string = kind.to_string();
|
||||||
|
|
||||||
// e.g. "is a directory" -> "Is a directory"
|
// e.g. "is a directory" -> "Is a directory"
|
||||||
let kind_string_capitalized = kind_string
|
let mut kind_string_capitalized = String::with_capacity(kind_string.len());
|
||||||
.char_indices()
|
|
||||||
.map(|(index, character)| {
|
for (index, ch) in kind_string.char_indices() {
|
||||||
if index == 0 {
|
if index == 0 {
|
||||||
character.to_uppercase().collect::<String>()
|
for cha in ch.to_uppercase() {
|
||||||
} else {
|
kind_string_capitalized.push(cha);
|
||||||
character.to_string()
|
|
||||||
}
|
}
|
||||||
})
|
} else {
|
||||||
.collect::<String>();
|
kind_string_capitalized.push(ch);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
format!("read error: {kind_string_capitalized}")
|
format!("read error: {kind_string_capitalized}")
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
// For the full copyright and license information, please view the LICENSE
|
// For the full copyright and license information, please view the LICENSE
|
||||||
// file that was distributed with this source code.
|
// 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 crate::error::{UResult, USimpleError};
|
||||||
use data_encoding::Encoding;
|
use data_encoding::Encoding;
|
||||||
|
|
Loading…
Reference in a new issue