fixed fmt
This commit is contained in:
1 parent
e99e307790
commit
e1cce7b5b3
5 files changed
+22
-18
No files matched your search
@@ -128,10 +128,7 @@ impl AccountStore {
|
||||
let replaced = self.accounts.iter().any(|a| a.uuid == *uuid);
|
||||
// re-adding the currently active account must not drop the selection:
|
||||
// the replacement takes over the old account's active flag.
|
||||
let replaced_active = self
|
||||
.accounts
|
||||
.iter()
|
||||
.any(|a| a.uuid == *uuid && a.active);
|
||||
let replaced_active = self.accounts.iter().any(|a| a.uuid == *uuid && a.active);
|
||||
let account_type = account.account_type.clone();
|
||||
let username = account.username.clone();
|
||||
self.accounts.retain(|a| a.uuid != *uuid);
|
||||
|
||||
@@ -152,7 +152,10 @@ fn store_set_active_out_of_bounds_keeps_selection() {
|
||||
store.add(create_offline_account("Alice"));
|
||||
store.add(create_offline_account("Bob"));
|
||||
store.set_active(99);
|
||||
assert!(store.accounts[0].active, "existing selection must survive a bad index");
|
||||
assert!(
|
||||
store.accounts[0].active,
|
||||
"existing selection must survive a bad index"
|
||||
);
|
||||
assert!(!store.accounts[1].active);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user