From 179075b311daeb7bc7d35ec4ed9d0469f6d232d7 Mon Sep 17 00:00:00 2001 From: "C. Titus Brown" Date: Tue, 12 Nov 2024 11:32:33 -0800 Subject: [PATCH] reset scaled on manifest after select --- src/core/src/manifest.rs | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/src/core/src/manifest.rs b/src/core/src/manifest.rs index a23776dfdc..807b3816a0 100644 --- a/src/core/src/manifest.rs +++ b/src/core/src/manifest.rs @@ -260,7 +260,7 @@ impl Manifest { impl Select for Manifest { fn select(self, selection: &Selection) -> Result { - let rows = self.records.iter().filter(|row| { + let rows: Vec<_> = self.records.iter().filter(|row| { let mut valid = true; valid = if let Some(ksize) = selection.ksize() { row.ksize == ksize @@ -289,10 +289,22 @@ impl Select for Manifest { valid }; valid - }); + }).cloned().collect(); + + // if scaled is set, update! + let rows: Vec<_> = if let Some(scaled) = selection.scaled() { + rows.iter().map(|r| { + let mut r = r.clone(); + r.scaled = scaled; + r + }).collect() + } else { + rows + }; + // TODO: with num as well? Ok(Manifest { - records: rows.cloned().collect(), + records: rows }) /*