feat: added default for Bin so hashmap doesn't have to be specified

This commit is contained in:
Strix 2023-10-14 22:39:50 +02:00
parent 24993f2f22
commit 671590a2fa
No known key found for this signature in database
GPG key ID: 49B2E37B8915B774

View file

@ -5,5 +5,15 @@ use serde::{Deserialize, Serialize};
#[derive(Debug, Clone, Serialize, Deserialize)] #[derive(Debug, Clone, Serialize, Deserialize)]
pub struct Bin { pub struct Bin {
pub root: String, pub root: String,
#[serde(default)]
pub checksums: HashMap<String, String>, pub checksums: HashMap<String, String>,
} }
impl Default for Bin {
fn default() -> Self {
Bin {
root: String::default(),
checksums: HashMap::default(),
}
}
}