Skip to content

Commit 5931d9e

Browse files
committed
Remove calls to clone from types that implement Copy
Clippy emits: warning: using `clone` on type `blockdata::transaction::OutPoint` which implements the `Copy` trait Remove calls to `clone` from types that implement `Copy`.
1 parent 1af4f23 commit 5931d9e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/blockdata/block.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ mod tests {
521521
}
522522

523523
// test with modified header
524-
let mut invalid_header: BlockHeader = some_header.clone();
524+
let mut invalid_header: BlockHeader = some_header;
525525
invalid_header.version += 1;
526526
match invalid_header.validate_pow(&invalid_header.target()) {
527527
Err(BlockBadProofOfWork) => (),

src/util/bip158.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -554,15 +554,15 @@ mod test {
554554
let mut si = scripts.iter();
555555
for tx in block.txdata.iter().skip(1) {
556556
for input in tx.input.iter() {
557-
txmap.insert(input.previous_output.clone(), Script::from(Vec::from_hex(si.next().unwrap().as_str().unwrap()).unwrap()));
557+
txmap.insert(input.previous_output, Script::from(Vec::from_hex(si.next().unwrap().as_str().unwrap()).unwrap()));
558558
}
559559
}
560560

561561
let filter = BlockFilter::new_script_filter(&block,
562562
|o| if let Some(s) = txmap.get(o) {
563563
Ok(s.clone())
564564
} else {
565-
Err(Error::UtxoMissing(o.clone()))
565+
Err(Error::UtxoMissing(*o))
566566
}).unwrap();
567567

568568
let test_filter = BlockFilter::new(filter_content.as_slice());

0 commit comments

Comments
 (0)