Skip to content

Commit

Permalink
clippy: map -> inspect when original item is returned
Browse files Browse the repository at this point in the history
Fixing a clippy lints regarding a usage of `map()` instead
of `inspect()`, when original item (closure argument) is returned
from the closure.
  • Loading branch information
muzarski committed Sep 16, 2024
1 parent 31f512c commit b784f96
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions scylla-proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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))?;
Expand Down

0 comments on commit b784f96

Please sign in to comment.