Use of take() instead of unwrap()

This commit is contained in:
Mauro D
2022-07-17 17:20:24 +00:00
parent 5cc21ed1b5
commit 8b20a25461
23 changed files with 165 additions and 39 deletions

View File

@@ -51,7 +51,17 @@ impl Changes {
self.changes.get(account_id).map(|changes| changes.iter())
}
pub fn has_type(&self, type_: TypeState) -> bool {
self.changes
.values()
.any(|changes| changes.contains_key(&type_))
}
pub fn into_inner(self) -> HashMap<String, HashMap<TypeState, String>> {
self.changes
}
pub fn is_empty(&self) -> bool {
!self.changes.values().any(|changes| !changes.is_empty())
}
}