Refactor users management (#4)
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
* Improve deletion of 2FA factors
This commit is contained in:
@@ -146,10 +146,6 @@ impl User {
|
||||
self.two_factor.push(factor);
|
||||
}
|
||||
|
||||
pub fn remove_factor(&mut self, factor_id: FactorID) {
|
||||
self.two_factor.retain(|f| f.id != factor_id);
|
||||
}
|
||||
|
||||
pub fn find_factor(&self, factor_id: &FactorID) -> Option<&TwoFactor> {
|
||||
self.two_factor.iter().find(|f| f.id.eq(factor_id))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user