Skip to content

Commit

Permalink
Merge pull request scylladb#1072 from muzarski/fix-clippy-0.1.81
Browse files Browse the repository at this point in the history
clippy: map -> inspect when original item is returned
  • Loading branch information
Lorak-mmk authored Sep 16, 2024
2 parents 0341198 + 0314f53 commit 9ff1161
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions scylla-proxy/src/proxy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -750,20 +750,22 @@ impl Doorkeeper {
desired_addr
};

socket.connect(real_addr).await.map(|ok| {
let stream = socket.connect(real_addr).await;
if let Ok(ok) = &stream {
info!(
"Connected to the cluster from {} at {}, intended shard {}.",
ok.local_addr().unwrap(),
real_addr,
shard_preserving_addr.port() % shards
);
ok
})
}
stream
} else {
TcpStream::connect(real_addr).await.map(|ok| {
let stream = TcpStream::connect(real_addr).await;
if stream.is_ok() {
info!("Connected to the cluster at {}.", real_addr);
ok
})
}
stream
}
.map_err(|err| DoorkeeperError::NodeConnectionAttempt(real_addr, err))?;

Expand Down

0 comments on commit 9ff1161

Please sign in to comment.