2020: day01: clippy warnings
This commit is contained in:
parent
c09ce94f6a
commit
27a25d5c2f
|
@ -39,13 +39,11 @@ fn part2(input: &str) -> Result<i64> {
|
||||||
fn find_2020_2_sum(entries: &[i64]) -> Result<(i64, i64)> {
|
fn find_2020_2_sum(entries: &[i64]) -> Result<(i64, i64)> {
|
||||||
let set: HashSet<i64> = entries.iter().copied().collect();
|
let set: HashSet<i64> = entries.iter().copied().collect();
|
||||||
|
|
||||||
for i in 0..entries.len() {
|
for a in entries {
|
||||||
let a = entries[i];
|
|
||||||
|
|
||||||
let b = 2020 - a;
|
let b = 2020 - a;
|
||||||
|
|
||||||
if set.contains(&b) {
|
if set.contains(&b) {
|
||||||
return Ok((a, b));
|
return Ok((*a, b));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue