Can create user accounts
This commit is contained in:
@@ -91,4 +91,21 @@ impl<E> EntityManager<E>
|
||||
pub fn cloned(&self) -> Vec<E> {
|
||||
self.list.clone()
|
||||
}
|
||||
|
||||
pub fn update_or_replace(&mut self, entry: E) -> Res {
|
||||
let mut found = false;
|
||||
for i in &mut self.list {
|
||||
if i == &entry {
|
||||
*i = entry.clone();
|
||||
found = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if !found {
|
||||
self.list.push(entry);
|
||||
}
|
||||
|
||||
self.save()
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user