Skip to content

Commit

Permalink
chore: Cargo fmt run
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzzypixelz committed Feb 27, 2024
1 parent 5b190d6 commit 01233ed
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 45 deletions.
6 changes: 4 additions & 2 deletions io/zenoh-links/zenoh-link-udp/src/multicast.rs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,8 @@ impl LinkManagerMulticastUdp {
IpAddr::V6(_) => x.is_ipv6(),
})
.take(1)
.collect::<Vec<IpAddr>>().first()
.collect::<Vec<IpAddr>>()
.first()
.copied(),
};
}
Expand All @@ -192,7 +193,8 @@ impl LinkManagerMulticastUdp {
}
})
.take(1)
.collect::<Vec<IpAddr>>().first()
.collect::<Vec<IpAddr>>()
.first()
.copied();

match iface {
Expand Down
10 changes: 7 additions & 3 deletions plugins/zenoh-backend-traits/src/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,11 @@ impl<S: Into<String> + AsRef<str>, 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(),
})
}
Expand Down Expand Up @@ -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(),
})
}
Expand Down
2 changes: 1 addition & 1 deletion plugins/zenoh-plugin-storage-manager/src/replica/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
29 changes: 17 additions & 12 deletions zenoh/src/net/routing/hat/linkstate_peer/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
27 changes: 16 additions & 11 deletions zenoh/src/net/routing/hat/p2p_peer/gossip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
29 changes: 17 additions & 12 deletions zenoh/src/net/routing/hat/router/network.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 1 addition & 4 deletions zenoh/src/session.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,10 +827,7 @@ impl Session {
})
}

pub(crate) fn declare_prefix<'a>(
&'a self,
prefix: &'a str,
) -> impl Resolve<ExprId> + 'a {
pub(crate) fn declare_prefix<'a>(&'a self, prefix: &'a str) -> impl Resolve<ExprId> + 'a {
ResolveClosure::new(move || {
trace!("declare_prefix({:?})", prefix);
let mut state = zwrite!(self.state);
Expand Down

0 comments on commit 01233ed

Please sign in to comment.