From ba6b56ae68d5842d814769418d484093865261aa Mon Sep 17 00:00:00 2001 From: Alex Auvolat Date: Mon, 14 Mar 2022 12:00:23 +0100 Subject: Fix some new clippy lints --- src/rpc/consul.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/rpc/consul.rs') 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 { -- cgit v1.2.3