use std::fmt::{Display, Formatter};
use serde::Deserialize;
#[derive(Deserialize, Clone, Debug)]
#[serde(rename_all = "camelCase")]
pub struct AccountDto {
pub puuid: String,
pub game_name: Option<String>,
pub tag_line: Option<String>,
}
impl Eq for AccountDto {}
impl PartialEq for AccountDto {
fn eq(&self, other: &Self) -> bool {
self.puuid == other.puuid
}
}
impl Into<String> for AccountDto {
fn into(self) -> String {
self.puuid
}
}
impl Display for AccountDto {
fn fmt(&self, f: &mut Formatter<'_>) -> std::fmt::Result {
write!(f,
"{}: {}#{}",
&self.puuid,
&self.game_name.clone().unwrap_or("EMPTY".to_string()),
&self.tag_line.clone().unwrap_or("NTL".to_string())
)
}
}