Skip to content

Commit

Permalink
reset scaled on manifest after select
Browse files Browse the repository at this point in the history
  • Loading branch information
ctb committed Nov 12, 2024
1 parent 7df6d04 commit 179075b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions src/core/src/manifest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@ impl Manifest {

impl Select for Manifest {
fn select(self, selection: &Selection) -> Result<Self> {
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
Expand Down Expand Up @@ -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| {

Check warning on line 296 in src/core/src/manifest.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/manifest.rs#L296

Added line #L296 was not covered by tests
let mut r = r.clone();
r.scaled = scaled;
r
}).collect()

Check warning on line 300 in src/core/src/manifest.rs

View check run for this annotation

Codecov / codecov/patch

src/core/src/manifest.rs#L299-L300

Added lines #L299 - L300 were not covered by tests
} else {
rows
};
// TODO: with num as well?

Ok(Manifest {
records: rows.cloned().collect(),
records: rows
})

/*
Expand Down

0 comments on commit 179075b

Please sign in to comment.