1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

clippy: simplify code according to nightly 'byte_char_slices' lint

https://rust-lang.github.io/rust-clippy/master/index.html#/byte_char_slices
This commit is contained in:
Ben Wiederhake 2024-07-18 15:14:54 +02:00
parent 84f8b7a98b
commit 471f047a64
6 changed files with 14 additions and 14 deletions

View file

@ -83,7 +83,7 @@ macro_rules! test_digest {
// The asterisk indicates that the digest was computed in
// binary mode.
let n = expected.len();
let expected = [&expected[..n - 3], &[b' ', b'-', b'\n']].concat();
let expected = [&expected[..n - 3], b" -\n"].concat();
new_ucmd!()
.args(&[DIGEST_ARG, BITS_ARG, "-t"])
.pipe_in("a\r\nb\r\nc\r\n")

View file

@ -1434,8 +1434,8 @@ fn check_complement_set2_too_big() {
#[test]
#[cfg(unix)]
fn test_truncate_non_utf8_set() {
let stdin = &[b'\x01', b'a', b'm', b'p', 0xfe_u8, 0xff_u8];
let set1 = OsStr::from_bytes(&[b'a', 0xfe_u8, 0xff_u8, b'z']);
let stdin = b"\x01amp\xfe\xff";
let set1 = OsStr::from_bytes(b"a\xfe\xffz"); // spell-checker:disable-line
let set2 = OsStr::from_bytes(b"01234");
new_ucmd!()