diff options
author | Guillermo Ramos | 2025-03-16 11:20:15 +0100 |
---|---|---|
committer | Guillermo Ramos | 2025-03-16 13:18:14 +0100 |
commit | b1709107d2a94eff5b05037d52e7b53aec9c7598 (patch) | |
tree | 2f6efa9ea876c4faaf22a9123f25183d191c1f84 /src | |
parent | 88cca41114a04f7cb6e8bda9ce72b836dbbddf6e (diff) | |
download | hiccup-b1709107d2a94eff5b05037d52e7b53aec9c7598.tar.gz |
Delete updates
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, |