1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-04 15:07:47 +00:00

refactor/polish ~ fix cargo clippy complaints (borrowed_box)

This commit is contained in:
Roy Ivy III 2019-12-29 12:17:18 -06:00
parent 8f2cdcfcb5
commit 6131f6f0e1

View file

@ -442,7 +442,7 @@ fn hashsum(
let f = safe_unwrap!(File::open(ck_filename));
let mut ckf = BufReader::new(Box::new(f) as Box<dyn Read>);
let real_sum = safe_unwrap!(digest_reader(
&mut digest,
&mut *digest,
&mut ckf,
binary_check,
output_bits
@ -459,7 +459,7 @@ fn hashsum(
}
}
} else {
let sum = safe_unwrap!(digest_reader(&mut digest, &mut file, binary, output_bits));
let sum = safe_unwrap!(digest_reader(&mut *digest, &mut file, binary, output_bits));
if tag {
println!("{} ({}) = {}", algoname, filename, sum);
} else {
@ -482,7 +482,7 @@ fn hashsum(
}
fn digest_reader<'a, T: Read>(
digest: &mut Box<dyn Digest + 'a>,
digest: &mut (dyn Digest + 'a),
reader: &mut BufReader<T>,
binary: bool,
output_bits: usize,