From 34f53baf85fb5c7163ec5d71a8ab9d45d3f271b6 Mon Sep 17 00:00:00 2001 From: mat Date: Sat, 22 Feb 2025 23:01:54 +0000 Subject: update to rust edition 2024 --- azalea-auth/src/auth.rs | 6 +++--- azalea-auth/src/certs.rs | 2 +- azalea-auth/src/sessionserver.rs | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'azalea-auth/src') diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index 55d7d36a..99dfc115 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -360,7 +360,7 @@ pub async fn get_ms_auth_token( tokio::time::sleep(std::time::Duration::from_secs(res.interval)).await; trace!("Polling to check if user has logged in..."); - if let Ok(access_token_response) = client + let res = client .post(format!( "https://login.live.com/oauth20_token.srf?client_id={client_id}" )) @@ -372,8 +372,8 @@ pub async fn get_ms_auth_token( .send() .await? .json::() - .await - { + .await; + if let Ok(access_token_response) = res { trace!("access_token_response: {:?}", access_token_response); let expires_at = SystemTime::now() + std::time::Duration::from_secs(access_token_response.expires_in); diff --git a/azalea-auth/src/certs.rs b/azalea-auth/src/certs.rs index 9f9147a8..7a6e12f9 100644 --- a/azalea-auth/src/certs.rs +++ b/azalea-auth/src/certs.rs @@ -1,6 +1,6 @@ use base64::Engine; use chrono::{DateTime, Utc}; -use rsa::{pkcs8::DecodePrivateKey, RsaPrivateKey}; +use rsa::{RsaPrivateKey, pkcs8::DecodePrivateKey}; use serde::Deserialize; use thiserror::Error; use tracing::trace; diff --git a/azalea-auth/src/sessionserver.rs b/azalea-auth/src/sessionserver.rs index e7052e11..87d0e32c 100755 --- a/azalea-auth/src/sessionserver.rs +++ b/azalea-auth/src/sessionserver.rs @@ -159,7 +159,7 @@ pub async fn serverside_auth( StatusCode::FORBIDDEN => { return Err(ServerSessionServerError::Unknown( res.json::().await?.error, - )) + )); } status_code => { // log the headers -- cgit v1.2.3