From 4c9de35cc2185b5ee8f844f907a50fa9a46b0bf2 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Tue, 18 Oct 2022 18:53:05 +0000 Subject: fix rustc panic --- azalea-auth/src/auth.rs | 12 +++++++++--- 1 file 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 { - 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; -- cgit v1.2.3