aboutsummaryrefslogtreecommitdiff
path: root/azalea-auth/src
diff options
context:
space:
mode:
authormat <github@matdoes.dev>2022-10-20 22:16:34 -0500
committermat <github@matdoes.dev>2022-10-20 22:16:34 -0500
commit8d0cad77846f61d3ab0bce55394ff127ede0b898 (patch)
tree638ee1a4c3b0f80cc1f68d10bd066e0dae0c1951 /azalea-auth/src
parent41606fdd14904ba9e80e2ee992bea0b02ec76348 (diff)
downloadazalea-drasl-8d0cad77846f61d3ab0bce55394ff127ede0b898.tar.xz
Remove let chains
Diffstat (limited to 'azalea-auth/src')
-rw-r--r--azalea-auth/src/auth.rs8
-rwxr-xr-xazalea-auth/src/lib.rs2
2 files changed, 5 insertions, 5 deletions
diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs
index ec20d31e..98ea4952 100644
--- a/azalea-auth/src/auth.rs
+++ b/azalea-auth/src/auth.rs
@@ -69,7 +69,8 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
let profile: ProfileResponse;
let minecraft_access_token: String;
- if let Some(account) = &cached_account && !account.mca.is_expired() {
+ if cached_account.is_some() && !cached_account.as_ref().unwrap().mca.is_expired() {
+ let account = cached_account.as_ref().unwrap();
// the minecraft auth data is cached and not expired, so we can just
// use that instead of doing auth all over again :)
profile = account.profile.clone();
@@ -102,7 +103,7 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
// Minecraft auth
let mca = auth_with_minecraft(&client, &xbl_auth.data.user_hash, &xsts_token).await?;
- minecraft_access_token = mca
+ minecraft_access_token = mca
.get()
.expect("Minecraft auth shouldn't have expired yet")
.access_token
@@ -129,7 +130,8 @@ pub async fn auth(email: &str, opts: AuthOpts) -> Result<AuthResult, AuthError>
profile: profile.clone(),
},
)
- .await {
+ .await
+ {
log::error!("{}", e);
}
}
diff --git a/azalea-auth/src/lib.rs b/azalea-auth/src/lib.rs
index 03e15c71..17c87636 100755
--- a/azalea-auth/src/lib.rs
+++ b/azalea-auth/src/lib.rs
@@ -1,5 +1,3 @@
-#![feature(let_chains)]
-
mod auth;
mod cache;
pub mod game_profile;