*: Apply clippy suggestions (#2540)

This commit is contained in:
Max Inden
2022-02-28 10:05:17 +01:00
committed by GitHub
parent b1859464c9
commit 99855b1d10
9 changed files with 37 additions and 56 deletions

View File

@ -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() {