chore: WIP of y2025::day_10 #298
ci.yml
on: push
Clippy validation
27s
Rustfmt check
14s
Matrix: build
Annotations
1 error and 8 warnings
|
Rustfmt check
Rustfmt has exited with 11 suggestions
|
|
Suggested formatting at line 94 (replaced with 3 lines):
aoclp_solutions/src/y2025/day_10.rs#L94
let captures = re
.captures(s)
.with_context(|| format!("invalid machine spec: {s}"))?;
|
|
Suggested formatting at lines 70-79 (replaced with 8 lines):
aoclp_solutions/src/y2025/day_10.rs#L70
let presses = self.button_wirings.iter().fold(max_steps, |max, wiring| {
let mut next = cur.clone();
for w in wiring {
next[*w] += 1;
}
let next_presses = self.fewest_presses_for_joltage_from(next, steps + 1, max, _cache);
min(max, next_presses)
});
|
|
Suggested formatting at line 66 (replaced with 6 lines):
aoclp_solutions/src/y2025/day_10.rs#L66
} else if steps == max_steps
|| cur
.iter()
.zip(self.joltage_reqs.iter())
.any(|(cur, req)| *cur > *req)
{
|
|
Suggested formatting at line 61 (replaced with 7 lines):
aoclp_solutions/src/y2025/day_10.rs#L61
fn fewest_presses_for_joltage_from(
&self,
cur: Vec<usize>,
steps: usize,
max_steps: usize,
_cache: &mut HashMap<Vec<usize>, usize>,
) -> usize {
|
|
Suggested formatting at line 56 (replaced with 6 lines):
aoclp_solutions/src/y2025/day_10.rs#L56
let presses = self.fewest_presses_for_joltage_from(
vec![0; self.joltage_reqs.len()],
0,
usize::MAX,
&mut cache,
);
|
|
Suggested formatting at lines 38-46 (replaced with 7 lines):
aoclp_solutions/src/y2025/day_10.rs#L38
self.button_wirings.iter().map(move |wiring| {
let mut next = l.clone();
for w in wiring {
next[*w] = !next[*w]
}
next
})
|
|
Suggested formatting at line 16 (replaced with 4 lines):
aoclp_solutions/src/y2025/day_10.rs#L16
input()
.par_iter()
.map(Machine::fewest_presses_for_joltage)
.sum()
|
|
Suggested formatting at line 10 (replaced with 2 lines):
aoclp_solutions/src/y2025/day_10.rs#L10
use itertools::Itertools;
use rayon::iter::{IntoParallelRefIterator, ParallelIterator};
|