2024: clippies

This commit is contained in:
ktims committed 2026-12-02 14:09:23 -07:00
1 parent 966ac945ed
commit 2121d0dc55
7 files changed
+69 -41

No files matched your search

+2 -2
View File
@@ -63,7 +63,7 @@ fn profit_for_sequence(changes: &[FxHashMap<[i8; 4], i8>], seq: &[i8]) -> i64 {
}
fn find_best_sequence(changes: &[FxHashMap<[i8; 4], i8>]) -> [i8; 4] {
let possible_seqs = (0..4).map(|_| (-9..=9i8)).multi_cartesian_product().collect_vec();
let possible_seqs = (0..4).map(|_| -9..=9i8).multi_cartesian_product().collect_vec();
let (best_seq, _best_profit) = possible_seqs
.par_iter()
.map_with(changes, |changes, seq| (seq, profit_for_sequence(changes, seq)))
@@ -131,7 +131,7 @@ mod tests {
#[test]
fn test_profit() {
assert_eq!(
profit_for_sequence(&vec![build_profit_map(&prices(123, 10))], &[-1, -1, 0, 2]),
profit_for_sequence(&[build_profit_map(&prices(123, 10))], &[-1, -1, 0, 2]),
6
);
let secrets = parse(EXAMPLE2);