2024: clippies
This commit is contained in:
7 files changed
+69
-41
No files matched your search
+2
-2
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user