aboutsummaryrefslogtreecommitdiff
path: root/src/rpc/consul.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rpc/consul.rs')
-rw-r--r--src/rpc/consul.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/rpc/consul.rs b/src/rpc/consul.rs
index e70288dd..15acbcef 100644
--- a/src/rpc/consul.rs
+++ b/src/rpc/consul.rs
@@ -51,10 +51,8 @@ pub async fn get_consul_nodes(
let pubkey = ent
.node_meta
.get("pubkey")
- .map(|k| hex::decode(&k).ok())
- .flatten()
- .map(|k| NodeID::from_slice(&k[..]))
- .flatten();
+ .and_then(|k| hex::decode(&k).ok())
+ .and_then(|k| NodeID::from_slice(&k[..]));
if let (Some(ip), Some(pubkey)) = (ip, pubkey) {
ret.push((pubkey, SocketAddr::new(ip, ent.service_port)));
} else {