Skip to content

Commit 7708f6e

Browse files
committed
clippy: replace .as_bytes().len() => .len()
1 parent beb56b1 commit 7708f6e

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/uu/split/src/split.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -492,7 +492,7 @@ impl Settings {
492492
}
493493
match first.as_str() {
494494
"\\0" => b'\0',
495-
s if s.as_bytes().len() == 1 => s.as_bytes()[0],
495+
s if s.len() == 1 => s.as_bytes()[0],
496496
s => return Err(SettingsError::MultiCharacterSeparator(s.to_string())),
497497
}
498498
}

src/uu/tac/src/tac.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ fn buffer_tac(data: &[u8], before: bool, separator: &str) -> std::io::Result<()>
184184
let mut out = BufWriter::new(out.lock());
185185

186186
// The number of bytes in the line separator.
187-
let slen = separator.as_bytes().len();
187+
let slen = separator.len();
188188

189189
// The index of the start of the next line in the `data`.
190190
//

0 commit comments

Comments
 (0)