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:
parent
beb56b10ab
commit
7708f6e39a
2 changed files with 2 additions and 2 deletions
|
@ -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())),
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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`.
|
||||
//
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue