mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-19 04:51:22 +00:00
*: Apply clippy suggestions (#2540)
This commit is contained in:
@ -473,14 +473,9 @@ where
|
||||
|
||||
/// Lists all mesh peers for a certain topic hash.
|
||||
pub fn mesh_peers(&self, topic_hash: &TopicHash) -> impl Iterator<Item = &PeerId> {
|
||||
self.mesh
|
||||
.get(topic_hash)
|
||||
.into_iter()
|
||||
.map(|x| x.iter())
|
||||
.flatten()
|
||||
self.mesh.get(topic_hash).into_iter().flat_map(|x| x.iter())
|
||||
}
|
||||
|
||||
/// Lists all mesh peers for all topics.
|
||||
pub fn all_mesh_peers(&self) -> impl Iterator<Item = &PeerId> {
|
||||
let mut res = BTreeSet::new();
|
||||
for peers in self.mesh.values() {
|
||||
|
Reference in New Issue
Block a user