chore: silence clippy warnings

- pareto/crowding.rs: rewrite the inner loop to iterate per-objective
  via index_axis-style indexing on `oriented` rather than naming an
  unused loop variable `k`.
- operators/{binary,permutation}.rs tests: pass parents via
  `std::slice::from_ref` instead of `&[parent.clone()]` to avoid the
  cloned_ref_to_slice_refs lint.

Pure cleanup — no behavior change, all 83 unit tests + 2 doctests still
pass.
This commit is contained in:
2026-05-04 19:28:32 -06:00
parent 2298abdc72
commit e3f5d3eb7b
3 changed files with 6 additions and 5 deletions
+2 -2
View File
@@ -45,7 +45,7 @@ mod tests {
let mut m = BitFlipMutation { probability: 0.0 };
let mut rng = rng_from_seed(0);
let parent = vec![false, true, false, true, true];
let children = m.vary(&[parent.clone()], &mut rng);
let children = m.vary(std::slice::from_ref(&parent), &mut rng);
assert_eq!(children.len(), 1);
assert_eq!(children[0], parent);
}
@@ -55,7 +55,7 @@ mod tests {
let mut m = BitFlipMutation { probability: 1.0 };
let mut rng = rng_from_seed(0);
let parent = vec![false, true, false, true, true];
let children = m.vary(&[parent.clone()], &mut rng);
let children = m.vary(std::slice::from_ref(&parent), &mut rng);
let expected: Vec<bool> = parent.iter().map(|b| !b).collect();
assert_eq!(children[0], expected);
}