2020: day01: clippy warnings

This commit is contained in:
Antoine Martin 2020-12-02 12:46:30 +01:00
parent c09ce94f6a
commit 27a25d5c2f

View file

@ -39,13 +39,11 @@ fn part2(input: &str) -> Result<i64> {
fn find_2020_2_sum(entries: &[i64]) -> Result<(i64, i64)> {
let set: HashSet<i64> = entries.iter().copied().collect();
for i in 0..entries.len() {
let a = entries[i];
for a in entries {
let b = 2020 - a;
if set.contains(&b) {
return Ok((a, b));
return Ok((*a, b));
}
}