Skip to content

Commit 8c0f967

Browse files
committed
nit: field init shorthand
1 parent 097c4db commit 8c0f967

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

stackslib/src/net/p2p.rs

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ struct NetworkHandleServer {
105105

106106
impl NetworkHandle {
107107
pub fn new(chan_in: SyncSender<NetworkRequest>) -> NetworkHandle {
108-
NetworkHandle { chan_in: chan_in }
108+
NetworkHandle { chan_in }
109109
}
110110

111111
/// Send out a command to the p2p thread. Do not bother waiting for the response.
@@ -175,7 +175,7 @@ impl NetworkHandle {
175175

176176
impl NetworkHandleServer {
177177
pub fn new(chan_in: Receiver<NetworkRequest>) -> NetworkHandleServer {
178-
NetworkHandleServer { chan_in: chan_in }
178+
NetworkHandleServer { chan_in }
179179
}
180180

181181
pub fn pair(bufsz: usize) -> (NetworkHandleServer, NetworkHandle) {
@@ -483,11 +483,11 @@ impl PeerNetwork {
483483
}
484484

485485
let mut network = PeerNetwork {
486-
peer_version: peer_version,
487-
epochs: epochs,
486+
peer_version,
487+
epochs,
488488

489-
local_peer: local_peer,
490-
chain_view: chain_view,
489+
local_peer,
490+
chain_view,
491491
chain_view_stable_consensus_hash: ConsensusHash([0u8; 20]),
492492
ast_rules: ASTRules::Typical,
493493
heaviest_affirmation_map: AffirmationMap::empty(),
@@ -506,8 +506,8 @@ impl PeerNetwork {
506506
tenure_start_block_id: StacksBlockId([0x00; 32]),
507507
current_reward_sets: BTreeMap::new(),
508508

509-
peerdb: peerdb,
510-
atlasdb: atlasdb,
509+
peerdb,
510+
atlasdb,
511511

512512
peers: PeerMap::new(),
513513
sockets: HashMap::new(),
@@ -523,8 +523,8 @@ impl PeerNetwork {
523523
p2p_network_handle: 0,
524524
http_network_handle: 0,
525525

526-
burnchain: burnchain,
527-
connection_opts: connection_opts,
526+
burnchain,
527+
connection_opts,
528528

529529
work_state: PeerNetworkWorkState::GetPublicIP,
530530
nakamoto_work_state: PeerNetworkWorkState::GetPublicIP,
@@ -555,8 +555,8 @@ impl PeerNetwork {
555555
attachments_downloader: None,
556556

557557
stacker_db_syncs: Some(stacker_db_sync_map),
558-
stacker_db_configs: stacker_db_configs,
559-
stackerdbs: stackerdbs,
558+
stacker_db_configs,
559+
stackerdbs,
560560

561561
prune_outbound_counts: HashMap::new(),
562562
prune_inbound_counts: HashMap::new(),
@@ -3493,7 +3493,7 @@ impl PeerNetwork {
34933493
}
34943494
let microblocks_data = MicroblocksData {
34953495
index_anchor_block: anchor_block_id.clone(),
3496-
microblocks: microblocks,
3496+
microblocks,
34973497
};
34983498

34993499
debug!(
@@ -4041,7 +4041,7 @@ impl PeerNetwork {
40414041
peer_version: nk.peer_version,
40424042
network_id: nk.network_id,
40434043
ts: get_epoch_time_secs(),
4044-
pubkey: pubkey,
4044+
pubkey,
40454045
},
40464046
);
40474047

@@ -5205,7 +5205,7 @@ mod test {
52055205
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0x7f,
52065206
0x00, 0x00, 0x01,
52075207
]),
5208-
port: port,
5208+
port,
52095209
},
52105210
public_key: Secp256k1PublicKey::from_hex(
52115211
"02fa66b66f8971a8cd4d20ffded09674e030f0f33883f337f34b95ad4935bac0e3",

0 commit comments

Comments
 (0)