Some fixes the compiler pointed out to me (#4482)

* Fix bug in availability-distribution.

Old fetches would not get cancelled as intended.

* Fix a few more warnings.
This commit is contained in:
Robert Klotzner
2021-12-07 17:48:20 +01:00
committed by GitHub
parent 157b8ce899
commit 0cafdd4d5e
4 changed files with 15 additions and 26 deletions
@@ -203,7 +203,9 @@ impl FetchTask {
/// Remove leaves and cancel the task, if it was the last one and the task has still been
/// fetching.
pub fn remove_leaves(&mut self, leaves: &HashSet<Hash>) {
self.live_in.difference(leaves);
for leaf in leaves {
self.live_in.remove(leaf);
}
if self.live_in.is_empty() && !self.is_finished() {
self.state = FetchedState::Canceled
}