Skip to content
This repository has been archived by the owner on Dec 22, 2023. It is now read-only.

Commit

Permalink
🚑️ Set default for n_battles
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenein committed Aug 4, 2023
1 parent 0205b43 commit 1e2b0da
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/models/vote.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,8 @@ pub struct Vote {
)]
pub rating: Rating,

#[serde(rename = "nb")]
pub n_battles: u32,
#[serde(rename = "nb", default)]
pub n_battles: Option<u32>,
}

impl Vote {
Expand All @@ -50,7 +50,7 @@ impl Vote {
account_id: account_id.into(),
tank_id,
},
n_battles,
n_battles: Some(n_battles),
rating,
timestamp: Utc::now(),
}
Expand Down

0 comments on commit 1e2b0da

Please sign in to comment.