mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 16:17:59 +00:00
Clean up sc-network (#9761)
* Clean up sc-network - Avoid using clone() for the Copy type `PeerId`. - Use `find_map` for `filter_map` and `next`. - Use `Self`. * More on Copy types * Cargo +nightly fmt --all * More .. * fmt * Revert vec![default_notif_handshake_message]
This commit is contained in:
@@ -256,7 +256,7 @@ impl IntoProtocolsHandler for NotifsHandlerProto {
|
||||
Protocol { config, in_upgrade, state: State::Closed { pending_opening: false } }
|
||||
})
|
||||
.collect(),
|
||||
peer_id: peer_id.clone(),
|
||||
peer_id: *peer_id,
|
||||
endpoint: connected_point.clone(),
|
||||
when_connection_open: Instant::now(),
|
||||
events_queue: VecDeque::with_capacity(16),
|
||||
@@ -463,7 +463,7 @@ impl NotifsHandlerProto {
|
||||
/// is always the same whether we open a substream ourselves or respond to handshake from
|
||||
/// the remote.
|
||||
pub fn new(list: impl Into<Vec<ProtocolConfig>>) -> Self {
|
||||
NotifsHandlerProto { protocols: list.into() }
|
||||
Self { protocols: list.into() }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -552,7 +552,7 @@ impl ProtocolsHandler for NotifsHandler {
|
||||
let (sync_tx, sync_rx) = mpsc::channel(SYNC_NOTIFICATIONS_BUFFER_SIZE);
|
||||
let notifications_sink = NotificationsSink {
|
||||
inner: Arc::new(NotificationsSinkInner {
|
||||
peer_id: self.peer_id.clone(),
|
||||
peer_id: self.peer_id,
|
||||
async_channel: FuturesMutex::new(async_tx),
|
||||
sync_channel: Mutex::new(sync_tx),
|
||||
}),
|
||||
|
||||
Reference in New Issue
Block a user