@@ -494,25 +494,24 @@ fn normalize_str_to_redactions(input: &str, pattern: &str, redactions: &Redactio
494
494
let mut pattern_lines = crate :: utils:: LinesWithTerminator :: new ( pattern) . peekable ( ) ;
495
495
' outer: while let Some ( pattern_line) = pattern_lines. next ( ) {
496
496
if is_line_elide ( pattern_line) {
497
- if let Some ( next_pattern_line) = pattern_lines. peek ( ) {
498
- for ( index_offset, next_input_line) in
499
- input_lines[ input_index..] . iter ( ) . copied ( ) . enumerate ( )
500
- {
501
- if line_matches ( next_input_line, next_pattern_line, redactions) {
502
- normalized. push ( pattern_line) ;
503
- input_index += index_offset;
504
- continue ' outer;
505
- }
506
- }
507
- // Give up doing further normalization
508
- break ;
509
- } else {
497
+ let Some ( next_pattern_line) = pattern_lines. peek ( ) else {
510
498
// Give up doing further normalization
511
499
normalized. push ( pattern_line) ;
512
500
// captured rest so don't copy remaining lines over
513
501
input_index = input_lines. len ( ) ;
514
502
break ;
503
+ } ;
504
+ for ( index_offset, next_input_line) in
505
+ input_lines[ input_index..] . iter ( ) . copied ( ) . enumerate ( )
506
+ {
507
+ if line_matches ( next_input_line, next_pattern_line, redactions) {
508
+ normalized. push ( pattern_line) ;
509
+ input_index += index_offset;
510
+ continue ' outer;
511
+ }
515
512
}
513
+ // Give up doing further normalization
514
+ break ;
516
515
} else {
517
516
let Some ( input_line) = input_lines. get ( input_index) else {
518
517
// Give up doing further normalization
0 commit comments