Basic user information parsing

This commit is contained in:
Natsu Kagami 2019-12-25 12:30:33 -05:00
parent c6ec62f33b
commit 71041533bf
5 changed files with 118 additions and 3 deletions

View file

@ -30,6 +30,7 @@ impl<'de> Deserialize<'de> for User {
count_sh: parse_from_str(&raw.count_rank_sh)?,
count_a: parse_from_str(&raw.count_rank_a)?,
rank: parse_from_str(&raw.pp_rank)?,
country_rank: parse_from_str(&raw.pp_country_rank)?,
level: parse_from_str(&raw.level)?,
pp: Some(parse_from_str(&raw.pp_raw)?).filter(|v| *v != 0.0),
accuracy: parse_from_str(&raw.accuracy)?,

View file

@ -175,6 +175,7 @@ pub struct User {
pub events: Vec<UserEvent>,
// Rankings
pub rank: u64,
pub country_rank: u64,
pub level: f64,
pub pp: Option<f64>,
pub accuracy: f64,