mirror of
https://github.com/RussellChamp/advent-of-code-2024-rust.git
synced 2026-10-27 23:52:29 +00:00
fix clippy issues and update benchmarks
This commit is contained in:
1 parent
6502e63efe
commit
ee6c70ef8a
11 files changed
+101
-97
No files matched your search
+3
-4
@@ -48,13 +48,13 @@ pub fn part_one(input: &str) -> Option<u32> {
|
||||
Some(total_tokens)
|
||||
}
|
||||
|
||||
pub fn part_two(input: &str) -> Option<u32> {
|
||||
pub fn part_two(_input: &str) -> Option<u32> {
|
||||
None
|
||||
}
|
||||
|
||||
// TODO figure out how to reference-ify this
|
||||
fn find_matches(machine: Machine) -> impl Iterator<Item=(u32, u32)> {
|
||||
let result = (0..=100).flat_map(move |a_presses| {
|
||||
(0..=100).flat_map(move |a_presses| {
|
||||
(0..=100).filter_map(move |b_presses| {
|
||||
let pos_x = machine.a_button.x * a_presses + machine.b_button.x * b_presses;
|
||||
let pos_y = machine.a_button.y * a_presses + machine.b_button.y * b_presses;
|
||||
@@ -65,8 +65,7 @@ fn find_matches(machine: Machine) -> impl Iterator<Item=(u32, u32)> {
|
||||
None
|
||||
}
|
||||
})
|
||||
});
|
||||
result
|
||||
})
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
|
||||
Reference in new issue
Block a user