diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -233,14 +233,14 @@ pub struct PeriodicUpdate { #[derive(Debug, Default, Serialize, Deserialize)] pub struct SimUpdates { - periodically: Vec<PeriodicUpdate>, + periodic: Vec<PeriodicUpdate>, by_month: HashMap<u32, SimUpdate>, } impl SimUpdates { fn get(&self, month: u32) -> Vec<SimUpdate> { let SimUpdates { - periodically, + periodic, by_month, } = self; @@ -250,7 +250,7 @@ impl SimUpdates { from, to, update, - } in periodically.iter() + } in periodic.iter() { let base = from.unwrap_or(0); if month % period == base && base <= month && to.unwrap_or(month + 1) > month { @@ -265,8 +265,8 @@ impl SimUpdates { } pub fn and(mut self, other: SimUpdates) -> Self { - for p in other.periodically.iter() { - self.periodically.push(p.clone()); + for p in other.periodic.iter() { + self.periodic.push(p.clone()); } for (k, v) in other.by_month { self.by_month.insert(k, v); @@ -298,7 +298,7 @@ impl fmt::Display for SimUpdate { impl SimUpdate { pub fn every(&self, months: u32) -> SimUpdates { let mut updates = SimUpdates::default(); - updates.periodically.push(PeriodicUpdate { + updates.periodic.push(PeriodicUpdate { period: months, from: None, to: None, |