diff --git a/crates/solverforge-solver/src/heuristic/move/list_ruin.rs b/crates/solverforge-solver/src/heuristic/move/list_ruin.rs index b61fbb64..6d29fb12 100644 --- a/crates/solverforge-solver/src/heuristic/move/list_ruin.rs +++ b/crates/solverforge-solver/src/heuristic/move/list_ruin.rs @@ -310,7 +310,7 @@ where Actually: after k insertions at positions orig_indices[0..k] (all <= orig_indices[k] since sorted), orig_indices[k]'s effective position has shifted by k. */ - for (&idx, val) in orig_indices.iter().zip(vals.into_iter()) { + for (&idx, val) in orig_indices.iter().zip(vals) { list_insert(s, orig_entity, idx, val); } })); diff --git a/crates/solverforge-solver/src/manager/phase_factory/list_clarke_wright.rs b/crates/solverforge-solver/src/manager/phase_factory/list_clarke_wright.rs index 79966b9b..f6afbe22 100644 --- a/crates/solverforge-solver/src/manager/phase_factory/list_clarke_wright.rs +++ b/crates/solverforge-solver/src/manager/phase_factory/list_clarke_wright.rs @@ -280,7 +280,7 @@ where } } } - savings.sort_unstable_by(|a, b| b.0.cmp(&a.0)); + savings.sort_unstable_by_key(|entry| std::cmp::Reverse(entry.0)); // Greedy merge for (merge_idx, (_, i, j)) in savings.iter().enumerate() { @@ -337,7 +337,7 @@ where } let candidate_route: Vec = test_ri .into_iter() - .chain(test_rj.into_iter()) + .chain(test_rj) .map(|idx| index_to_element(solution, idx).into()) .collect(); if !feasible(solution, &candidate_route) { @@ -387,10 +387,7 @@ where { let sd = step_scope.score_director_mut(); - for (entity_idx, index_route) in available_entity_slots - .into_iter() - .zip(non_empty.into_iter()) - { + for (entity_idx, index_route) in available_entity_slots.into_iter().zip(non_empty) { sd.before_variable_changed(descriptor_index, entity_idx); let element_route: Vec = index_route .iter()