Skip to content

Commit

Permalink
Use iter
Browse files Browse the repository at this point in the history
  • Loading branch information
zanieb committed Feb 22, 2024
1 parent 646b429 commit 9c8d153
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions crates/uv/tests/common/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -150,15 +150,13 @@ impl TestContext {

/// Standard snapshot filters _plus_ those for this test context.
pub fn filters(&self) -> Vec<(&str, &str)> {
let mut filters = INSTA_FILTERS.to_vec();

for (pattern, replacement) in self.filters.iter().rev() {
// Put test context snapshots before the default filters
// This ensures we don't replace other patterns inside paths from the test context first
filters.insert(0, (pattern, replacement));
}

filters
// Put test context snapshots before the default filters
// This ensures we don't replace other patterns inside paths from the test context first
self.filters
.iter()
.map(|(p, r)| (p.as_str(), r.as_str()))
.chain(INSTA_FILTERS.into_iter().copied())
.collect()
}
}

Expand Down

0 comments on commit 9c8d153

Please sign in to comment.