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:
Liu-Cheng Xu authored and GitHub committed 2021-09-13 20:11:29 +02:00
1 parent 0472a43855
commit 2562f8c65e
37 files changed
+475 -526

No files matched your search

@@ -289,7 +289,7 @@ where
if a.iter().any(|p| matches!(p, multiaddr::Protocol::P2p(_))) {
a
} else {
a.with(multiaddr::Protocol::P2p(peer_id.clone()))
a.with(multiaddr::Protocol::P2p(peer_id))
}
})
}