diff options
| author | 2026-01-14 14:54:57 +0800 | |
|---|---|---|
| committer | 2026-01-14 14:54:57 +0800 | |
| commit | 986e76df89028e37ea3f872f12508763b5723e32 (patch) | |
| tree | 5a9bc2d44109ea1e5a38442d91fdc3a359669738 /src-tauri/src/core/account_storage.rs | |
| parent | 05e28f64035783040d4f1aef03723b640925bfcb (diff) | |
| download | DropOut-986e76df89028e37ea3f872f12508763b5723e32.tar.gz DropOut-986e76df89028e37ea3f872f12508763b5723e32.zip | |
refactor: improve code readability by formatting and restructuring function calls
Diffstat (limited to 'src-tauri/src/core/account_storage.rs')
| -rw-r--r-- | src-tauri/src/core/account_storage.rs | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/src-tauri/src/core/account_storage.rs b/src-tauri/src/core/account_storage.rs index b8e15e1..9512213 100644 --- a/src-tauri/src/core/account_storage.rs +++ b/src-tauri/src/core/account_storage.rs @@ -131,13 +131,17 @@ impl AccountStorage { pub fn get_active_account(&self) -> Option<(StoredAccount, Option<String>)> { let store = self.load(); if let Some(active_id) = &store.active_account_id { - store.accounts.iter().find(|a| &a.id() == active_id).map(|a| { - let ms_token = match a { - StoredAccount::Microsoft(m) => m.ms_refresh_token.clone(), - _ => None, - }; - (a.clone(), ms_token) - }) + store + .accounts + .iter() + .find(|a| &a.id() == active_id) + .map(|a| { + let ms_token = match a { + StoredAccount::Microsoft(m) => m.ms_refresh_token.clone(), + _ => None, + }; + (a.clone(), ms_token) + }) } else { None } |