From b784f96a8f503c57013690256dc12fc5ed710137 Mon Sep 17 00:00:00 2001 From: muzarski Date: Mon, 16 Sep 2024 06:04:56 +0200 Subject: [PATCH] clippy: map -> inspect when original item is returned Fixing a clippy lints regarding a usage of `map()` instead of `inspect()`, when original item (closure argument) is returned from the closure. --- scylla-proxy/src/proxy.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/scylla-proxy/src/proxy.rs b/scylla-proxy/src/proxy.rs index 7a79d7a9d1..b591bfb974 100644 --- a/scylla-proxy/src/proxy.rs +++ b/scylla-proxy/src/proxy.rs @@ -750,19 +750,17 @@ impl Doorkeeper { desired_addr }; - socket.connect(real_addr).await.map(|ok| { + socket.connect(real_addr).await.inspect(|ok| { info!( "Connected to the cluster from {} at {}, intended shard {}.", ok.local_addr().unwrap(), real_addr, shard_preserving_addr.port() % shards ); - ok }) } else { - TcpStream::connect(real_addr).await.map(|ok| { + TcpStream::connect(real_addr).await.inspect(|_| { info!("Connected to the cluster at {}.", real_addr); - ok }) } .map_err(|err| DoorkeeperError::NodeConnectionAttempt(real_addr, err))?;