From b1709107d2a94eff5b05037d52e7b53aec9c7598 Mon Sep 17 00:00:00 2001 From: Guillermo Ramos Date: Sun, 16 Mar 2025 11:20:15 +0100 Subject: Delete updates --- src/lib.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src') diff --git a/src/lib.rs b/src/lib.rs index 1637be7..cf8240c 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -233,14 +233,14 @@ pub struct PeriodicUpdate { #[derive(Debug, Default, Serialize, Deserialize)] pub struct SimUpdates { - periodically: Vec, + periodic: Vec, by_month: HashMap, } impl SimUpdates { fn get(&self, month: u32) -> Vec { 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, -- cgit v1.2.3