[2016][rust] clippy

profile
Alpha Chen 8 years ago
parent af660a1137
commit 143f149736

@ -6,7 +6,7 @@ pub fn solve(input: &str) -> Result<String> {
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
}
}

@ -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()
}
}

Loading…
Cancel
Save