Can request new user password on login
This commit is contained in:
@@ -46,6 +46,17 @@ impl<E> EntityManager<E> where E: serde::Serialize + serde::de::DeserializeOwned
|
||||
self.save()
|
||||
}
|
||||
|
||||
/// Replace entries in the list that matches a criteria
|
||||
pub fn replace_entries<F>(&mut self, filter: F, el: &E) -> Res where F: Fn(&E) -> bool {
|
||||
for i in 0..self.list.len() {
|
||||
if filter(&self.list[i]) {
|
||||
self.list[i] = el.clone();
|
||||
}
|
||||
}
|
||||
|
||||
self.save()
|
||||
}
|
||||
|
||||
/// Iterate over the entries of this entity manager
|
||||
pub fn iter(&self) -> Iter<'_, E> {
|
||||
self.list.iter()
|
||||
|
||||
Reference in New Issue
Block a user