chore: fix clippy warnings in NSGA-III, SPEA2, and compare example

- nsga3: drop redundant `.into_iter()` in extend call; use
  `#[allow(clippy::needless_range_loop)]` on the back-substitution
  loop where `j` indexes into the matrix; remove an unneeded
  `return` keyword in a closure.
- spea2: switch `pool.extend(x.drain(..))` to `pool.append(&mut x)`.
- examples/compare.rs DTLZ2 evaluator: same `needless_range_loop`
  silencer on the inner cosine product loop.
This commit is contained in:
2026-05-04 19:59:18 -06:00
parent 5728ee14e2
commit ac1a5856cf
3 changed files with 7 additions and 4 deletions
+1
View File
@@ -79,6 +79,7 @@ impl Problem for Dtlz2 {
let mut f = vec![0.0_f64; m];
for i in 0..m {
let mut prod = scale;
#[allow(clippy::needless_range_loop)] // Body indexes `x[j]`.
for j in 0..(m - i - 1) {
prod *= (x[j] * std::f64::consts::FRAC_PI_2).cos();
}