Skip to content

Commit

Permalink
fix(filter): Take redactions into account for Array elides
Browse files Browse the repository at this point in the history
Fixes #352
  • Loading branch information
epage committed Aug 14, 2024
1 parent b71f8d0 commit 9344f20
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions crates/snapbox/src/filter/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -473,10 +473,11 @@ fn normalize_array_to_redactions(
input_index = input.len();
break;
};
let Some(index_offset) = input[input_index..]
.iter()
.position(|next_input_elem| next_input_elem == *next_pattern_elem)
else {
let Some(index_offset) = input[input_index..].iter().position(|next_input_elem| {
let mut next_input_elem = next_input_elem.clone();
normalize_value_to_redactions(&mut next_input_elem, next_pattern_elem, redactions);
next_input_elem == **next_pattern_elem
}) else {
// Give up as we can't find where the elide ends
break;
};
Expand Down

0 comments on commit 9344f20

Please sign in to comment.