diff options
| author | Ubuntu <github@matdoes.dev> | 2022-10-18 18:53:05 +0000 |
|---|---|---|
| committer | Ubuntu <github@matdoes.dev> | 2022-10-18 18:53:05 +0000 |
| commit | 4c9de35cc2185b5ee8f844f907a50fa9a46b0bf2 (patch) | |
| tree | b491a9ef920d15525810b1d12212c25985fda25f /azalea-auth | |
| parent | 051f52474dcfbc1694a93439d446617205769fad (diff) | |
| download | azalea-drasl-4c9de35cc2185b5ee8f844f907a50fa9a46b0bf2.tar.xz | |
fix rustc panic
Diffstat (limited to 'azalea-auth')
| -rw-r--r-- | azalea-auth/src/auth.rs | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index 5f96d4be..0cc36fcf 100644 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -55,9 +55,15 @@ pub enum AuthError { /// anything. You should just have it be the actual email so it's not confusing /// though, and in case the Microsoft API does start providing the real email. pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError> { - let cached_account = if let Some(cache_file) = &opts.cache_file && let Some(account) = cache::get_account_in_cache(cache_file, email).await { - Some(account) - } else { None }; + let cached_account = if let Some(cache_file) = &opts.cache_file { + if let Some(account) = cache::get_account_in_cache(cache_file, email).await { + Some(account) + } else { + None + } + } else { + None + }; // these two MUST be set by the end, since we return them in AuthResult let profile: ProfileResponse; |
