diff --git a/2016/rust/src/day_06.rs b/2016/rust/src/day_06.rs index aa00f90..2500f6c 100644 --- a/2016/rust/src/day_06.rs +++ b/2016/rust/src/day_06.rs @@ -6,7 +6,7 @@ pub fn solve(input: &str) -> Result { let mut counters = HashMap::new(); for line in input.lines() { for (i, c) in line.chars().enumerate() { - let mut col = counters.entry(i).or_insert_with(|| HashMap::new()); + let mut col = counters.entry(i).or_insert_with(HashMap::new); *col.entry(c).or_insert(0) += 1 } } diff --git a/2016/rust/src/day_07.rs b/2016/rust/src/day_07.rs index 8edb446..c734f2f 100644 --- a/2016/rust/src/day_07.rs +++ b/2016/rust/src/day_07.rs @@ -67,7 +67,7 @@ impl IP7 { let v: Vec<_> = s.chars().collect(); v.windows(3) .filter(|w| (w[0] != w[1]) && (w[0] == w[2])) - .map(|w| w.iter().map(|&x| x).collect()) + .map(|w| w.iter().cloned().collect()) .collect() } }