From cb5d9317608d1d4c0c1911abacc90ee58e691436 Mon Sep 17 00:00:00 2001 From: rumblefrog Date: Tue, 26 Apr 2022 15:59:19 -0400 Subject: [PATCH] fix: avoid tempering last_updated for individual symbol when file is updated --- Cargo.lock | 2 +- chumbucket/Cargo.toml | 2 +- chumbucket/src/commands/generate.rs | 7 ++----- 3 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 271f263..73e6451 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -128,7 +128,7 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "chumbucket" -version = "0.4.1" +version = "0.4.2" dependencies = [ "alternator", "anyhow", diff --git a/chumbucket/Cargo.toml b/chumbucket/Cargo.toml index 1287086..da10a62 100644 --- a/chumbucket/Cargo.toml +++ b/chumbucket/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "chumbucket" -version = "0.4.1" +version = "0.4.2" description = "Chums through manifest, include, and index files" authors = ["rumblefrog "] edition = "2021" diff --git a/chumbucket/src/commands/generate.rs b/chumbucket/src/commands/generate.rs index 3897f18..0f279dc 100644 --- a/chumbucket/src/commands/generate.rs +++ b/chumbucket/src/commands/generate.rs @@ -313,13 +313,10 @@ impl<'b> ChronicleProcessor<'b> { new: &HashMap, version: Option, ) -> u64 { - let mut diff = 0; - // Handle any new entries for (k, v) in new { if let Entry::Vacant(entry) = existing.entry(k.clone()) { entry.insert(v.clone()); - diff += 1; } } @@ -332,12 +329,12 @@ impl<'b> ChronicleProcessor<'b> { } } - diff += to_remove.len() as u64; - for k in to_remove { existing.remove(&k); } + let mut diff = 0; + // At this point, both list should have the same keys, so we can safely iterate over them // Handle any updated entries for (k, v) in existing.iter_mut() {