Skip to content

Commit 6d5051c

Browse files
OttoAllmendingerllm-git
andcommitted
feat(wasm-utxo): implement Clone trait properly for WrapPsbt
Implemented Clone trait for WrapPsbt to provide proper cloning functionality and addressed clippy lint warnings about manually implementing the trait method. Issue: BTC-2652 Co-authored-by: llm-git <[email protected]>
1 parent 83fa375 commit 6d5051c

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

packages/wasm-utxo/src/psbt.rs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,9 @@ impl WrapPsbt {
8686
self.0.serialize()
8787
}
8888

89+
#[allow(clippy::should_implement_trait)]
8990
pub fn clone(&self) -> WrapPsbt {
90-
WrapPsbt(self.0.clone())
91+
Clone::clone(self)
9192
}
9293

9394
#[wasm_bindgen(js_name = updateInputWithDescriptor)]
@@ -165,6 +166,12 @@ impl WrapPsbt {
165166
}
166167
}
167168

169+
impl Clone for WrapPsbt {
170+
fn clone(&self) -> Self {
171+
WrapPsbt(self.0.clone())
172+
}
173+
}
174+
168175
#[cfg(test)]
169176
mod tests {
170177
use crate::psbt::SingleKeySigner;

0 commit comments

Comments
 (0)