Skip to content

Commit 1b056da

Browse files
committed
style(services): simplify nested if in scan_full_diff_with_patterns
1 parent 1c6a338 commit 1b056da

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

src/services/safety.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -296,11 +296,11 @@ pub fn scan_full_diff_with_patterns(
296296
}
297297

298298
// Parse hunk header: @@ -1,5 +1,6 @@
299-
if let Some(caps) = HUNK_HEADER.captures(line) {
300-
if let Ok(start) = caps[1].parse::<usize>() {
301-
current_line = Some(start);
302-
continue;
303-
}
299+
if let Some(caps) = HUNK_HEADER.captures(line)
300+
&& let Ok(start) = caps[1].parse::<usize>()
301+
{
302+
current_line = Some(start);
303+
continue;
304304
}
305305

306306
let Some(ref mut line_num) = current_line else {

0 commit comments

Comments
 (0)