1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

clippy: replace .as_bytes().len() => .len()

This commit is contained in:
Sylvestre Ledru 2024-12-17 22:47:45 +01:00
parent beb56b10ab
commit 7708f6e39a
2 changed files with 2 additions and 2 deletions

View file

@ -492,7 +492,7 @@ impl Settings {
}
match first.as_str() {
"\\0" => b'\0',
s if s.as_bytes().len() == 1 => s.as_bytes()[0],
s if s.len() == 1 => s.as_bytes()[0],
s => return Err(SettingsError::MultiCharacterSeparator(s.to_string())),
}
}

View file

@ -184,7 +184,7 @@ fn buffer_tac(data: &[u8], before: bool, separator: &str) -> std::io::Result<()>
let mut out = BufWriter::new(out.lock());
// The number of bytes in the line separator.
let slen = separator.as_bytes().len();
let slen = separator.len();
// The index of the start of the next line in the `data`.
//