ci: fix clippy

This commit is contained in:
Xavier Morel
2024-12-02 10:28:00 +01:00
parent 79b7b21297
commit 473fa97733
2 changed files with 5 additions and 5 deletions

View File

@@ -19,9 +19,9 @@ Solutions for [Advent of Code](https://adventofcode.com/) in [Rust](https://www.
| Day | Part 1 | Part 2 |
| :---: | :---: | :---: |
| [Day 1](./src/bin/01.rs) | `72.0µs` | `76.8µs` |
| [Day 2](./src/bin/02.rs) | `333.6µs` | `642.1µs` |
| [Day 2](./src/bin/02.rs) | `215.6µs` | `371.6µs` |
**Total: 1.12ms**
**Total: 0.74ms**
<!--- benchmarking table --->
---

View File

@@ -2,7 +2,7 @@ advent_of_code::solution!(2);
use std::cmp::Ordering;
fn validate_input_p1(input: &Vec<u32>) -> bool {
fn validate_input_p1(input: &[u32]) -> bool {
input
.iter()
.fold(
@@ -30,7 +30,7 @@ fn validate_input_p2(input: &Vec<u32>) -> bool {
}
for i in 0..input.len() {
let mut input2 = input.clone();
let mut input2 = input.to_owned();
input2.remove(i);
if validate_input_p1(&input2) {
return true;
@@ -50,7 +50,7 @@ pub fn part_one(input: &str) -> Option<usize> {
.map(|nb| nb.parse::<u32>().expect("parsing failed"))
.collect::<Vec<u32>>()
})
.filter(validate_input_p1)
.filter(|s| validate_input_p1(s))
.count()
.into()
}