mirror of
https://github.com/sreedevk/deduplicator.git
synced 2026-09-07 02:24:24 +00:00
fix critical error
This commit is contained in:
@@ -61,7 +61,11 @@ fn scan(app_opts: &Params) -> Result<Vec<File>> {
|
|||||||
.map(|fpath| File {
|
.map(|fpath| File {
|
||||||
path: fpath.clone(),
|
path: fpath.clone(),
|
||||||
hash: None,
|
hash: None,
|
||||||
size: Some(fs::metadata(fpath).unwrap().len()),
|
size: Some(
|
||||||
|
fs::metadata(fpath)
|
||||||
|
.map(|metadata| metadata.len())
|
||||||
|
.unwrap_or_default(),
|
||||||
|
),
|
||||||
})
|
})
|
||||||
.filter(|file| filters::is_file_gt_min_size(app_opts, file))
|
.filter(|file| filters::is_file_gt_min_size(app_opts, file))
|
||||||
.collect();
|
.collect();
|
||||||
@@ -84,7 +88,7 @@ fn process_file_index(
|
|||||||
IndexCritera::Hash => {
|
IndexCritera::Hash => {
|
||||||
file.hash = Some(hash_file(&file.path).unwrap_or_default());
|
file.hash = Some(hash_file(&file.path).unwrap_or_default());
|
||||||
store
|
store
|
||||||
.entry(file.clone().hash.unwrap())
|
.entry(file.clone().hash.unwrap_or_default())
|
||||||
.and_modify(|fileset| fileset.push(file.clone()))
|
.and_modify(|fileset| fileset.push(file.clone()))
|
||||||
.or_insert_with(|| vec![file]);
|
.or_insert_with(|| vec![file]);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user