Skip to content

Commit 6516a89

Browse files
authored
Merge pull request #894 from nekonako/main
chore : replace filter_map() with find_map()
2 parents f7719a4 + 9b27e8d commit 6516a89

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)