File tree Expand file tree Collapse file tree 6 files changed +12
-7
lines changed Expand file tree Collapse file tree 6 files changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -264,7 +264,7 @@ impl TestSigners {
264
264
265
265
let aggregate_public_key: Vec < u8 > =
266
266
rand:: thread_rng ( ) . sample_iter ( Standard ) . take ( 33 ) . collect ( ) ;
267
- self . aggregate_public_key = aggregate_public_key . clone ( ) ;
267
+ self . aggregate_public_key . clone_from ( & aggregate_public_key ) ;
268
268
aggregate_public_key
269
269
}
270
270
}
Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ impl Trie {
281
281
) ) ) ;
282
282
}
283
283
284
- value. path = cur_leaf. path_bytes ( ) . clone ( ) ;
284
+ value. path . clone_from ( cur_leaf. path_bytes ( ) ) ;
285
285
286
286
let leaf_hash = get_leaf_hash ( value) ;
287
287
Original file line number Diff line number Diff line change @@ -1438,7 +1438,7 @@ impl BurnchainConfigFile {
1438
1438
// check magic bytes and set if not defined
1439
1439
let mainnet_magic = ConfigFile :: mainnet ( ) . burnchain . unwrap ( ) . magic_bytes ;
1440
1440
if self . magic_bytes . is_none ( ) {
1441
- self . magic_bytes = mainnet_magic . clone ( ) ;
1441
+ self . magic_bytes . clone_from ( & mainnet_magic ) ;
1442
1442
}
1443
1443
if self . magic_bytes != mainnet_magic {
1444
1444
return Err ( format ! (
Original file line number Diff line number Diff line change @@ -562,7 +562,10 @@ impl NakamotoBlockProposal {
562
562
// Clone signatures from block proposal
563
563
// These have already been validated by `validate_nakamoto_block_burnchain()``
564
564
block. header . miner_signature = self . block . header . miner_signature . clone ( ) ;
565
- block. header . signer_signature = self . block . header . signer_signature . clone ( ) ;
565
+ block
566
+ . header
567
+ . signer_signature
568
+ . clone_from ( & self . block . header . signer_signature ) ;
566
569
567
570
// Clone the timestamp from the block proposal, which has already been validated
568
571
block. header . timestamp = self . block . header . timestamp ;
Original file line number Diff line number Diff line change @@ -1181,7 +1181,8 @@ impl ConversationP2P {
1181
1181
& mut self ,
1182
1182
stacker_db_data : & StackerDBHandshakeData ,
1183
1183
) {
1184
- self . db_smart_contracts = stacker_db_data. smart_contracts . clone ( ) ;
1184
+ self . db_smart_contracts
1185
+ . clone_from ( & stacker_db_data. smart_contracts ) ;
1185
1186
}
1186
1187
1187
1188
/// Forget about this peer's stacker DB replication state
Original file line number Diff line number Diff line change @@ -474,7 +474,7 @@ impl PeerNetwork {
474
474
) ;
475
475
let pub_ip = connection_opts. public_ip_address . clone ( ) ;
476
476
let pub_ip_learned = pub_ip. is_none ( ) ;
477
- local_peer. public_ip_address = pub_ip . clone ( ) ;
477
+ local_peer. public_ip_address . clone_from ( & pub_ip ) ;
478
478
479
479
if connection_opts. disable_inbound_handshakes {
480
480
debug ! ( "{:?}: disable inbound handshakes" , & local_peer) ;
@@ -4119,7 +4119,8 @@ impl PeerNetwork {
4119
4119
/// Get the local peer from the peer DB, but also preserve the public IP address
4120
4120
pub fn load_local_peer ( & self ) -> Result < LocalPeer , net_error > {
4121
4121
let mut lp = PeerDB :: get_local_peer ( & self . peerdb . conn ( ) ) ?;
4122
- lp. public_ip_address = self . local_peer . public_ip_address . clone ( ) ;
4122
+ lp. public_ip_address
4123
+ . clone_from ( & self . local_peer . public_ip_address ) ;
4123
4124
Ok ( lp)
4124
4125
}
4125
4126
You can’t perform that action at this time.
0 commit comments