Remove redundant clone
Clippy emits: warning: redundant clone Remove the redundant calls to clone.
This commit is contained in:
parent
cf8de73169
commit
a8039e1742
|
@ -1092,7 +1092,7 @@ mod tests {
|
|||
let expected_strippedsize = (EXPECTED_WEIGHT - tx_bytes.len()) / (WITNESS_SCALE_FACTOR - 1);
|
||||
assert_eq!(realtx.strippedsize(), expected_strippedsize);
|
||||
// Construct a transaction without the witness data.
|
||||
let mut tx_without_witness = realtx.clone();
|
||||
let mut tx_without_witness = realtx;
|
||||
tx_without_witness.input.iter_mut().for_each(|input| input.witness.clear());
|
||||
assert_eq!(tx_without_witness.weight(), expected_strippedsize*WITNESS_SCALE_FACTOR);
|
||||
assert_eq!(tx_without_witness.size(), expected_strippedsize);
|
||||
|
|
|
@ -651,7 +651,7 @@ mod test {
|
|||
query.push(p.clone());
|
||||
}
|
||||
query.push(Vec::from_hex("abcdef").unwrap());
|
||||
let mut input = Cursor::new(bytes.clone());
|
||||
let mut input = Cursor::new(bytes);
|
||||
assert!(!reader.match_all(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -393,7 +393,7 @@ mod tests {
|
|||
let mut builder = compose_taproot_builder(0x51, &[2, 2, 2]);
|
||||
builder = builder.add_leaf_with_ver(3, Script::from_hex("b9").unwrap(), LeafVersion::from_consensus(0xC2).unwrap()).unwrap();
|
||||
builder = builder.add_hidden_node(3, sha256::Hash::default()).unwrap();
|
||||
assert!(TapTree::from_builder(builder.clone()).is_err());
|
||||
assert!(TapTree::from_builder(builder).is_err());
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
|
Loading…
Reference in New Issue