Skip to content

Commit 9b27e8d

Browse files
committed
chore : replace filter_map() with find_map()
1 parent f7719a4 commit 9b27e8d

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/exercise.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,8 +217,7 @@ path = "{}.rs""#,
217217
let matched_line_index = source
218218
.lines()
219219
.enumerate()
220-
.filter_map(|(i, line)| if re.is_match(line) { Some(i) } else { None })
221-
.next()
220+
.find_map(|(i, line)| if re.is_match(line) { Some(i) } else { None })
222221
.expect("This should not happen at all");
223222

224223
let min_line = ((matched_line_index as i32) - (CONTEXT as i32)).max(0) as usize;

0 commit comments

Comments
 (0)