Skip to content

Commit

Permalink
fix: anticipate stats field not being present
Browse files Browse the repository at this point in the history
  • Loading branch information
MaxOhn committed Jul 20, 2024
1 parent 5ed96a6 commit 8791d50
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/model/ranking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -203,8 +203,7 @@ impl<'de> Visitor<'de> for UserStatsVisitor {
let playtime = playtime.ok_or_else(|| Error::missing_field("play_time"))?;
let pp = pp.ok_or_else(|| Error::missing_field("pp"))?;
let ranked_score = ranked_score.ok_or_else(|| Error::missing_field("ranked_score"))?;
let rank_change_since_30_days = rank_change_since_30_days
.ok_or_else(|| Error::missing_field("rank_change_since_30_days"))?;
let rank_change_since_30_days = rank_change_since_30_days.unwrap_or_default();
let replays_watched =
replays_watched.ok_or_else(|| Error::missing_field("replays_watched_by_others"))?;
let total_hits = total_hits.ok_or_else(|| Error::missing_field("total_hits"))?;
Expand Down

0 comments on commit 8791d50

Please sign in to comment.