We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
unwrap_or_default
1 parent 95f2cf5 commit e5bef1dCopy full SHA for e5bef1d
src/day_01.rs
@@ -10,7 +10,7 @@ pub fn part_1() -> i64 {
10
pub fn part_2() -> i64 {
11
let counts = list(deux).counts();
12
list(un)
13
- .map(|n| n * (counts.get(&n).copied().unwrap_or(0) as i64))
+ .map(|n| n * (counts.get(&n).copied().unwrap_or_default() as i64))
14
.sum()
15
}
16
0 commit comments