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:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user