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

Commit 1e2b0da

Browse files
committed
🚑️ Set default for n_battles
1 parent 0205b43 commit 1e2b0da

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/models/vote.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ pub struct Vote {
3434
)]
3535
pub rating: Rating,
3636

37-
#[serde(rename = "nb")]
38-
pub n_battles: u32,
37+
#[serde(rename = "nb", default)]
38+
pub n_battles: Option<u32>,
3939
}
4040

4141
impl Vote {
@@ -50,7 +50,7 @@ impl Vote {
5050
account_id: account_id.into(),
5151
tank_id,
5252
},
53-
n_battles,
53+
n_battles: Some(n_battles),
5454
rating,
5555
timestamp: Utc::now(),
5656
}

0 commit comments

Comments
 (0)