Skip to content

Commit e5bef1d

Browse files
committed
Use unwrap_or_default
1 parent 95f2cf5 commit e5bef1d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/day_01.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ pub fn part_1() -> i64 {
1010
pub fn part_2() -> i64 {
1111
let counts = list(deux).counts();
1212
list(un)
13-
.map(|n| n * (counts.get(&n).copied().unwrap_or(0) as i64))
13+
.map(|n| n * (counts.get(&n).copied().unwrap_or_default() as i64))
1414
.sum()
1515
}
1616

0 commit comments

Comments
 (0)