Can delete user account

This commit is contained in:
2022-04-08 17:54:51 +02:00
parent 65dac1e923
commit c7d075f94e
5 changed files with 92 additions and 6 deletions

View File

@ -92,7 +92,7 @@ impl<E> EntityManager<E>
self.list.clone()
}
pub fn update_or_replace(&mut self, entry: E) -> Res {
pub fn update_or_push(&mut self, entry: E) -> Res {
let mut found = false;
for i in &mut self.list {
if i == &entry {
@ -108,4 +108,9 @@ impl<E> EntityManager<E>
self.save()
}
pub fn remove(&mut self, entry: &E) -> Res {
self.list.retain(|x| x != entry);
self.save()
}
}