mirror of
https://github.com/mat-1/azalea.git
synced 2025-08-02 14:26:04 +00:00
Use Uuid's serde feature
This commit is contained in:
parent
15a7085514
commit
382d9aa371
2 changed files with 4 additions and 4 deletions
|
@ -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<serde_json::Value>,
|
||||
pub capes: Vec<serde_json::Value>,
|
||||
|
|
|
@ -31,7 +31,7 @@ pub struct Account {
|
|||
/// This is an Arc<Mutex> so it can be modified by [`Self::refresh`].
|
||||
pub access_token: Option<Arc<Mutex<String>>>,
|
||||
/// Only required for online-mode accounts.
|
||||
pub uuid: Option<uuid::Uuid>,
|
||||
pub uuid: Option<Uuid>,
|
||||
|
||||
/// 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(),
|
||||
},
|
||||
|
|
Loading…
Add table
Reference in a new issue