1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

cksum: fixed clippy and fmt errors

This commit is contained in:
D9nni 2024-01-10 16:49:52 +02:00
parent 911df1d76c
commit 9a76997b0a

View file

@ -177,18 +177,11 @@ where
if options.raw {
let bytes = match options.algo_name {
ALGORITHM_OPTIONS_CRC => {
let bytes = sum.parse::<u32>().unwrap().to_be_bytes();
bytes.to_vec()
}
ALGORITHM_OPTIONS_CRC => sum.parse::<u32>().unwrap().to_be_bytes().to_vec(),
ALGORITHM_OPTIONS_SYSV | ALGORITHM_OPTIONS_BSD => {
let bytes = sum.parse::<u16>().unwrap().to_be_bytes();
bytes.to_vec()
}
_ => {
let bytes = decode(sum).unwrap();
bytes
sum.parse::<u16>().unwrap().to_be_bytes().to_vec()
}
_ => decode(sum).unwrap(),
};
stdout().write_all(&bytes)?;
return Ok(());