error: custom attribute panicked
--> src\day1.rs:9:1
|
9 | #[aoc_generator(day1, pt1_windows2)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: A generator is already defined: Runner { generator: Some(Generator { name: "generate", out_t: "Vec < u32 >", special_type: None }), solver: None }
error: custom attribute panicked
--> src\day1.rs:22:1
|
22 | #[aoc(day1, part1_windows2)]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
= help: message: runners must have a defined part: "Failed to parse part: part1_windows2"
error: could not compile `aoc-2021` due to 2 previous errors
An error occurs : cargo build failed with code 101
#[aoc_generator(day1)]
fn generate(input: &str) -> Vec<u32> {
input.lines().flat_map(|s| s.parse()).collect()
}
#[aoc_generator(day1, pt1_windows2)]
fn generate(input: &str) -> Vec<u32> {
input.lines().flat_map(|s| s.parse()).collect()
}
#[aoc(day1, part1)]
fn solve_part1(input: &[u32]) -> usize {
input
.windows(2)
.filter(|window| window[0] < window[1])
.count()
}
#[aoc(day1, part1, windows2)]
fn solve_part1_windows2(input: &[u32]) -> usize {
input
.windows(2)
.filter(|window| window[0] < window[1])
.count()
}