Skip to content

Commit eccfec0

Browse files
committed
chore: Apply Clippy lint redundant_clone using cargo clippy --fix
1 parent 11823df commit eccfec0

File tree

7 files changed

+10
-14
lines changed

7 files changed

+10
-14
lines changed

clarity/src/vm/docs/mod.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2734,9 +2734,7 @@ fn make_all_api_reference() -> ReferenceAPIs {
27342734
#[allow(clippy::expect_used)]
27352735
pub fn make_json_api_reference() -> String {
27362736
let api_out = make_all_api_reference();
2737-
serde_json::to_string(&api_out)
2738-
.expect("Failed to serialize documentation")
2739-
.to_string()
2737+
serde_json::to_string(&api_out).expect("Failed to serialize documentation")
27402738
}
27412739

27422740
#[cfg(test)]

pox-locking/src/events.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -545,7 +545,6 @@ fn create_event_info_data_code(
545545
"#,
546546
delegate_to = opt
547547
.data
548-
.clone()
549548
.map(|boxed_value| *boxed_value)
550549
.unwrap()
551550
.expect_tuple()

stacks-common/src/util/tests.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,6 @@ impl<T: Default + Clone> TestFlag<T> {
9494
/// assert_eq!(test_flag.get(), 123);
9595
/// ```
9696
pub fn get(&self) -> T {
97-
self.0.lock().unwrap().clone().unwrap_or_default().clone()
97+
self.0.lock().unwrap().clone().unwrap_or_default()
9898
}
9999
}

stacks-signer/src/signerdb.rs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ mod tests {
11011101
.unwrap()
11021102
.expect("Unable to get block from db");
11031103

1104-
assert_eq!(BlockInfo::from(block_proposal_1.clone()), block_info);
1104+
assert_eq!(BlockInfo::from(block_proposal_1), block_info);
11051105

11061106
// Test looking up a block with an unknown hash
11071107
let block_info = db
@@ -1116,7 +1116,7 @@ mod tests {
11161116
.unwrap()
11171117
.expect("Unable to get block from db");
11181118

1119-
assert_eq!(BlockInfo::from(block_proposal_2.clone()), block_info);
1119+
assert_eq!(BlockInfo::from(block_proposal_2), block_info);
11201120
}
11211121

11221122
#[test]
@@ -1543,12 +1543,11 @@ mod tests {
15431543
&StacksPrivateKey::new(),
15441544
)),
15451545
};
1546-
let tenure_change_tx_payload =
1547-
TransactionPayload::TenureChange(tenure_change_payload.clone());
1546+
let tenure_change_tx_payload = TransactionPayload::TenureChange(tenure_change_payload);
15481547
let tenure_change_tx = StacksTransaction::new(
15491548
TransactionVersion::Testnet,
15501549
TransactionAuth::from_p2pkh(&StacksPrivateKey::new()).unwrap(),
1551-
tenure_change_tx_payload.clone(),
1550+
tenure_change_tx_payload,
15521551
);
15531552

15541553
let consensus_hash_1 = ConsensusHash([0x01; 20]);

testnet/stacks-node/src/burnchains/bitcoin_regtest_controller.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2316,7 +2316,7 @@ impl SerializedTx {
23162316

23172317
pub fn to_hex(&self) -> String {
23182318
let formatted_bytes: Vec<String> = self.bytes.iter().map(|b| format!("{b:02x}")).collect();
2319-
formatted_bytes.join("").to_string()
2319+
formatted_bytes.join("")
23202320
}
23212321
}
23222322

testnet/stacks-node/src/nakamoto_node/signer_coordinator.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ impl SignerCoordinator {
8080
// Create the stacker DB listener
8181
let mut listener = StackerDBListener::new(
8282
stackerdb_channel,
83-
node_keep_running.clone(),
83+
node_keep_running,
8484
keep_running.clone(),
8585
reward_set,
8686
burn_tip,

testnet/stacks-node/src/neon_node.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2396,7 +2396,7 @@ impl BlockMinerThread {
23962396
&burn_db,
23972397
&self.burn_block,
23982398
&stackerdbs,
2399-
SignerMessage::MockBlock(mock_block.clone()),
2399+
SignerMessage::MockBlock(mock_block),
24002400
MinerSlotID::BlockPushed, // There is no specific slot for mock miner messages. Let's use BlockPushed for MockBlock since MockProposal uses BlockProposal.
24012401
self.config.is_mainnet(),
24022402
&mut miners_stackerdb,
@@ -3757,7 +3757,7 @@ impl RelayerThread {
37573757
}
37583758

37593759
let Some(mut miner_thread_state) =
3760-
self.create_block_miner(registered_key, last_burn_block.clone(), issue_timestamp_ms)
3760+
self.create_block_miner(registered_key, last_burn_block, issue_timestamp_ms)
37613761
else {
37623762
return false;
37633763
};

0 commit comments

Comments
 (0)