Skip to content

Commit c0db099

Browse files
committed
use unwrap_or_default
1 parent a81daf2 commit c0db099

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2024/day5/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ fn part1(input: &str) -> usize {
2121
updates
2222
.filter_map(|update| {
2323
update
24-
.is_sorted_by(|a, b| ordering.get(b).map(|v| v.contains(a)).unwrap_or(false))
24+
.is_sorted_by(|a, b| ordering.get(b).map(|v| v.contains(a)).unwrap_or_default())
2525
.then_some(update[update.len() / 2])
2626
})
2727
.sum()

0 commit comments

Comments
 (0)