From 382d9aa3717416e142b172d0f61db97e12caee01 Mon Sep 17 00:00:00 2001 From: EightFactorial Date: Wed, 18 Jan 2023 12:48:37 -0800 Subject: [PATCH] Use Uuid's serde feature --- azalea-auth/src/auth.rs | 4 ++-- azalea-client/src/account.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/azalea-auth/src/auth.rs b/azalea-auth/src/auth.rs index bed15d74..e668a947 100755 --- a/azalea-auth/src/auth.rs +++ b/azalea-auth/src/auth.rs @@ -10,6 +10,7 @@ use std::{ time::{Instant, SystemTime, UNIX_EPOCH}, }; use thiserror::Error; +use uuid::Uuid; #[derive(Default)] pub struct AuthOpts { @@ -209,8 +210,7 @@ pub struct GameOwnershipItem { #[derive(Debug, Clone, Deserialize, Serialize)] pub struct ProfileResponse { - // todo: make the id a uuid - pub id: String, + pub id: Uuid, pub name: String, pub skins: Vec, pub capes: Vec, diff --git a/azalea-client/src/account.rs b/azalea-client/src/account.rs index d1c20cc8..79feb1a7 100755 --- a/azalea-client/src/account.rs +++ b/azalea-client/src/account.rs @@ -31,7 +31,7 @@ pub struct Account { /// This is an Arc so it can be modified by [`Self::refresh`]. pub access_token: Option>>, /// Only required for online-mode accounts. - pub uuid: Option, + pub uuid: Option, /// The parameters (i.e. email) that were passed for creating this /// [`Account`]. This is used to for automatic reauthentication when we get @@ -85,7 +85,7 @@ impl Account { Ok(Self { username: auth_result.profile.name, access_token: Some(Arc::new(Mutex::new(auth_result.access_token))), - uuid: Some(Uuid::parse_str(&auth_result.profile.id).expect("Invalid UUID")), + uuid: Some(auth_result.profile.id), auth_opts: AuthOpts::Microsoft { email: email.to_string(), },