From cb4b5ec12ca619bfad2a6f4ab6fbdedc4948c038 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 01:25:47 +0000 Subject: [PATCH 1/2] Fix Clippy explicit-counter-loop in solvate --- crates/bio-forge/src/ops/solvate.rs | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/crates/bio-forge/src/ops/solvate.rs b/crates/bio-forge/src/ops/solvate.rs index 44832ce..37ec8c0 100644 --- a/crates/bio-forge/src/ops/solvate.rs +++ b/crates/bio-forge/src/ops/solvate.rs @@ -316,13 +316,10 @@ pub fn solvate_structure(structure: &mut Structure, config: &SolvateConfig) -> R let mut water_positions = Vec::with_capacity(new_waters.len()); solvent_chain.reserve(new_waters.len()); - let mut res_id_counter = 1; - - for mut residue in new_waters { + for (res_id_counter, mut residue) in (1..).zip(new_waters.into_iter()) { residue.id = res_id_counter; solvent_chain.add_residue(residue); water_positions.push(res_id_counter); - res_id_counter += 1; } replace_with_ions( From 03af102d363ca24d2e9bc32ae52c0e831e0095e8 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Sat, 23 May 2026 01:26:03 +0000 Subject: [PATCH 2/2] Remove redundant into_iter in solvate loop --- crates/bio-forge/src/ops/solvate.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/bio-forge/src/ops/solvate.rs b/crates/bio-forge/src/ops/solvate.rs index 37ec8c0..757f152 100644 --- a/crates/bio-forge/src/ops/solvate.rs +++ b/crates/bio-forge/src/ops/solvate.rs @@ -316,7 +316,7 @@ pub fn solvate_structure(structure: &mut Structure, config: &SolvateConfig) -> R let mut water_positions = Vec::with_capacity(new_waters.len()); solvent_chain.reserve(new_waters.len()); - for (res_id_counter, mut residue) in (1..).zip(new_waters.into_iter()) { + for (res_id_counter, mut residue) in (1..).zip(new_waters) { residue.id = res_id_counter; solvent_chain.add_residue(residue); water_positions.push(res_id_counter);