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`.
This commit is contained in:
Tobin C. Harding 2022-06-07 15:09:58 +10:00
parent 2b8d93ec4b
commit b24a112f08
2 changed files with 3 additions and 3 deletions

View File

@ -521,7 +521,7 @@ mod tests {
}
// test with modified header
let mut invalid_header: BlockHeader = some_header.clone();
let mut invalid_header: BlockHeader = some_header;
invalid_header.version += 1;
match invalid_header.validate_pow(&invalid_header.target()) {
Err(BlockBadProofOfWork) => (),

View File

@ -554,7 +554,7 @@ mod test {
let mut si = scripts.iter();
for tx in block.txdata.iter().skip(1) {
for input in tx.input.iter() {
txmap.insert(input.previous_output.clone(), Script::from(Vec::from_hex(si.next().unwrap().as_str().unwrap()).unwrap()));
txmap.insert(input.previous_output, Script::from(Vec::from_hex(si.next().unwrap().as_str().unwrap()).unwrap()));
}
}
@ -562,7 +562,7 @@ mod test {
|o| if let Some(s) = txmap.get(o) {
Ok(s.clone())
} else {
Err(Error::UtxoMissing(o.clone()))
Err(Error::UtxoMissing(*o))
}).unwrap();
let test_filter = BlockFilter::new(filter_content.as_slice());