Skip to content

Commit 4192061

Browse files
committed
Remove redundant clone
Clippy emits: warning: redundant clone Remove the redundant calls to clone.
1 parent 35dd77a commit 4192061

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/blockdata/transaction.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1092,7 +1092,7 @@ mod tests {
10921092
let expected_strippedsize = (EXPECTED_WEIGHT - tx_bytes.len()) / (WITNESS_SCALE_FACTOR - 1);
10931093
assert_eq!(realtx.strippedsize(), expected_strippedsize);
10941094
// Construct a transaction without the witness data.
1095-
let mut tx_without_witness = realtx.clone();
1095+
let mut tx_without_witness = realtx;
10961096
tx_without_witness.input.iter_mut().for_each(|input| input.witness.clear());
10971097
assert_eq!(tx_without_witness.weight(), expected_strippedsize*WITNESS_SCALE_FACTOR);
10981098
assert_eq!(tx_without_witness.size(), expected_strippedsize);

src/util/bip158.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -651,7 +651,7 @@ mod test {
651651
query.push(p.clone());
652652
}
653653
query.push(Vec::from_hex("abcdef").unwrap());
654-
let mut input = Cursor::new(bytes.clone());
654+
let mut input = Cursor::new(bytes);
655655
assert!(!reader.match_all(&mut input, &mut query.iter().map(|v| v.as_slice())).unwrap());
656656
}
657657
}

src/util/psbt/serialize.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -393,7 +393,7 @@ mod tests {
393393
let mut builder = compose_taproot_builder(0x51, &[2, 2, 2]);
394394
builder = builder.add_leaf_with_ver(3, Script::from_hex("b9").unwrap(), LeafVersion::from_consensus(0xC2).unwrap()).unwrap();
395395
builder = builder.add_hidden_node(3, sha256::Hash::default()).unwrap();
396-
assert!(TapTree::from_builder(builder.clone()).is_err());
396+
assert!(TapTree::from_builder(builder).is_err());
397397
}
398398

399399
#[test]

0 commit comments

Comments
 (0)