What changed, and why it matters
This is a minor code cleanup commit. It removes unnecessary `.into_iter()` calls in three places where Rust will automatically handle iteration. The behavior of the code is unchanged, and there is no security issue.
No action needed. This is a non-functional lint-driven cleanup.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit removes explicit .into_iter() calls on Vec fields (self.inputs, self.outputs, other.inputs, other.outputs) inside for loops that use .zip(). In Rust, for loops automatically call IntoIterator::into_iter, so the explicit call was redundant. The change was flagged by Clippy on a newer nightly toolchain. The move semantics and iteration behavior remain identical.
Changed components
bitcoin/src/psbt/mod.rsInspect captured patch +3 / −3
diff --git a/bitcoin/src/psbt/mod.rs b/bitcoin/src/psbt/mod.rs
index b949574f..41ca8a8f 100644
--- a/bitcoin/src/psbt/mod.rs
+++ b/bitcoin/src/psbt/mod.rs
@@ -175,7 +175,7 @@ impl Psbt {
fn internal_extract_tx(self) -> Transaction {
let mut tx: Transaction = self.unsigned_tx;
- for (vin, psbtin) in tx.inputs.iter_mut().zip(self.inputs.into_iter()) {
+ for (vin, psbtin) in tx.inputs.iter_mut().zip(self.inputs) {
vin.script_sig = psbtin.final_script_sig.unwrap_or_default();
vin.witness = psbtin.final_script_witness.unwrap_or_default();
}
@@ -268,11 +268,11 @@ impl Psbt {
self.proprietary.extend(other.proprietary);
self.unknown.extend(other.unknown);
- for (self_input, other_input) in self.inputs.iter_mut().zip(other.inputs.into_iter()) {
+ for (self_input, other_input) in self.inputs.iter_mut().zip(other.inputs) {
self_input.combine(other_input);
}
- for (self_output, other_output) in self.outputs.iter_mut().zip(other.outputs.into_iter()) {
+ for (self_output, other_output) in self.outputs.iter_mut().zip(other.outputs) {
self_output.combine(other_output);
}
Why this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.