We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 1682730 commit a3a7330Copy full SHA for a3a7330
src/hasher.rs
@@ -16,7 +16,7 @@ const BUFFER_SIZE: usize = 4096 * 8;
16
fn hash_file<D: Digest>(filename: impl AsRef<str>) -> anyhow::Result<Output<D>> {
17
let filesize = usize::try_from(file_size(filename.as_ref())?).ok();
18
19
- if filesize.map_or(false, |size| size <= BUFFER_SIZE) {
+ if filesize.is_some_and(|size| size <= BUFFER_SIZE) {
20
// this file is smaller than the buffer size, so we can hash it all at once
21
return hash_file_whole::<D>(filename);
22
}
0 commit comments