Add information output to BM-remove

This commit is contained in:
Matthias Beyer 2016-01-02 16:09:44 +01:00
parent 522f1dccff
commit 4c95e403e9

View file

@ -143,15 +143,21 @@ impl<'a> BM<'a> {
let f = file.deref().borrow(); let f = file.deref().borrow();
self.rt.store().remove(f.id().clone()) self.rt.store().remove(f.id().clone())
}) })
.all(|x| x); .fold((0, 0), |acc, succeeded| {
let (worked, failed) = acc;
if succeeded {
(worked + 1, failed)
} else {
(worked, failed + 1)
}
});
if result { let (worked, failed) = result;
info!("Removing succeeded");
} else {
info!("Removing failed");
}
return result; info!("Removing succeeded for {} files", worked);
info!("Removing failed for {} files", failed);
return failed == 0;
} }
/** /**