diff --git a/io/zenoh-links/zenoh-link-udp/src/multicast.rs b/io/zenoh-links/zenoh-link-udp/src/multicast.rs index 1a5b4c076b..497120ed0d 100644 --- a/io/zenoh-links/zenoh-link-udp/src/multicast.rs +++ b/io/zenoh-links/zenoh-link-udp/src/multicast.rs @@ -173,7 +173,8 @@ impl LinkManagerMulticastUdp { IpAddr::V6(_) => x.is_ipv6(), }) .take(1) - .collect::>().first() + .collect::>() + .first() .copied(), }; } @@ -192,7 +193,8 @@ impl LinkManagerMulticastUdp { } }) .take(1) - .collect::>().first() + .collect::>() + .first() .copied(); match iface { diff --git a/plugins/zenoh-backend-traits/src/config.rs b/plugins/zenoh-backend-traits/src/config.rs index 864caf52eb..e3fe484e5d 100644 --- a/plugins/zenoh-backend-traits/src/config.rs +++ b/plugins/zenoh-backend-traits/src/config.rs @@ -200,8 +200,11 @@ impl + AsRef, V: AsObject> TryFrom<(S, &V)> for PluginConfi storages, rest: value .into_iter() - .filter(|&(k, _v)| (!["__required__", "backend_search_dirs", "volumes", "storages"] - .contains(&k.as_str()))).map(|(k, v)| (k.clone(), v.clone())) + .filter(|&(k, _v)| { + (!["__required__", "backend_search_dirs", "volumes", "storages"] + .contains(&k.as_str())) + }) + .map(|(k, v)| (k.clone(), v.clone())) .collect(), }) } @@ -310,7 +313,8 @@ impl VolumeConfig { required, rest: config .iter() - .filter(|&(k, _v)| (!["__path__", "__required__"].contains(&k.as_str()))).map(|(k, v)| (k.clone(), v.clone())) + .filter(|&(k, _v)| (!["__path__", "__required__"].contains(&k.as_str()))) + .map(|(k, v)| (k.clone(), v.clone())) .collect(), }) } diff --git a/plugins/zenoh-plugin-storage-manager/src/replica/mod.rs b/plugins/zenoh-plugin-storage-manager/src/replica/mod.rs index e0eaf41dfd..b743a70451 100644 --- a/plugins/zenoh-plugin-storage-manager/src/replica/mod.rs +++ b/plugins/zenoh-plugin-storage-manager/src/replica/mod.rs @@ -40,7 +40,7 @@ pub mod storage; pub use align_queryable::AlignQueryable; pub use aligner::Aligner; pub use digest::{Digest, DigestConfig, EraType, LogEntry}; -pub use snapshotter::{Snapshotter}; +pub use snapshotter::Snapshotter; pub use storage::{ReplicationService, StorageService}; const ERA: &str = "era"; diff --git a/zenoh/src/net/routing/hat/linkstate_peer/network.rs b/zenoh/src/net/routing/hat/linkstate_peer/network.rs index 74a2a34963..77bef7706d 100644 --- a/zenoh/src/net/routing/hat/linkstate_peer/network.rs +++ b/zenoh/src/net/routing/hat/linkstate_peer/network.rs @@ -773,22 +773,27 @@ impl Network { let idxs = self .graph .node_indices() - .filter(|&idx| (self.full_linkstate + .filter(|&idx| { + (self.full_linkstate || self.gossip_multihop || self.links.values().any(|link| link.zid == zid) || (self.router_peers_failover_brokering && idx == self.idx - && whatami == WhatAmI::Router))).map(|idx| ( - idx, - Details { - zid: true, - locators: self.propagate_locators(idx), - links: self.full_linkstate - || (self.router_peers_failover_brokering - && idx == self.idx - && whatami == WhatAmI::Router), - }, - )) + && whatami == WhatAmI::Router)) + }) + .map(|idx| { + ( + idx, + Details { + zid: true, + locators: self.propagate_locators(idx), + links: self.full_linkstate + || (self.router_peers_failover_brokering + && idx == self.idx + && whatami == WhatAmI::Router), + }, + ) + }) .collect(); self.send_on_link(idxs, &transport); free_index diff --git a/zenoh/src/net/routing/hat/p2p_peer/gossip.rs b/zenoh/src/net/routing/hat/p2p_peer/gossip.rs index 0fbd40258c..96dc57613a 100644 --- a/zenoh/src/net/routing/hat/p2p_peer/gossip.rs +++ b/zenoh/src/net/routing/hat/p2p_peer/gossip.rs @@ -509,20 +509,25 @@ impl Network { let idxs = self .graph .node_indices() - .filter(|&idx| (self.gossip_multihop + .filter(|&idx| { + (self.gossip_multihop || self.links.values().any(|link| link.zid == zid) || (self.router_peers_failover_brokering && idx == self.idx - && whatami == WhatAmI::Router))).map(|idx| ( - idx, - Details { - zid: true, - locators: self.propagate_locators(idx), - links: (self.router_peers_failover_brokering - && idx == self.idx - && whatami == WhatAmI::Router), - }, - )) + && whatami == WhatAmI::Router)) + }) + .map(|idx| { + ( + idx, + Details { + zid: true, + locators: self.propagate_locators(idx), + links: (self.router_peers_failover_brokering + && idx == self.idx + && whatami == WhatAmI::Router), + }, + ) + }) .collect(); self.send_on_link(idxs, &transport); free_index diff --git a/zenoh/src/net/routing/hat/router/network.rs b/zenoh/src/net/routing/hat/router/network.rs index 893ac9848f..71ec8c0dcc 100644 --- a/zenoh/src/net/routing/hat/router/network.rs +++ b/zenoh/src/net/routing/hat/router/network.rs @@ -778,22 +778,27 @@ impl Network { let idxs = self .graph .node_indices() - .filter(|&idx| (self.full_linkstate + .filter(|&idx| { + (self.full_linkstate || self.gossip_multihop || self.links.values().any(|link| link.zid == zid) || (self.router_peers_failover_brokering && idx == self.idx - && whatami == WhatAmI::Router))).map(|idx| ( - idx, - Details { - zid: true, - locators: self.propagate_locators(idx), - links: self.full_linkstate - || (self.router_peers_failover_brokering - && idx == self.idx - && whatami == WhatAmI::Router), - }, - )) + && whatami == WhatAmI::Router)) + }) + .map(|idx| { + ( + idx, + Details { + zid: true, + locators: self.propagate_locators(idx), + links: self.full_linkstate + || (self.router_peers_failover_brokering + && idx == self.idx + && whatami == WhatAmI::Router), + }, + ) + }) .collect(); self.send_on_link(idxs, &transport); free_index diff --git a/zenoh/src/session.rs b/zenoh/src/session.rs index b15a2e3602..23950ad9c2 100644 --- a/zenoh/src/session.rs +++ b/zenoh/src/session.rs @@ -827,10 +827,7 @@ impl Session { }) } - pub(crate) fn declare_prefix<'a>( - &'a self, - prefix: &'a str, - ) -> impl Resolve + 'a { + pub(crate) fn declare_prefix<'a>(&'a self, prefix: &'a str) -> impl Resolve + 'a { ResolveClosure::new(move || { trace!("declare_prefix({:?})", prefix); let mut state = zwrite!(self.state);