Skip to content

Commit

Permalink
refiller: Remove unnecessary clone
Browse files Browse the repository at this point in the history
PoolRefiller::use_keyspace took keyspace_name by ref even though it
actually needs the ownership, so it had to clone it.
Taking by value removes this clone.
  • Loading branch information
Lorak-mmk committed Dec 7, 2024
1 parent 4b6ad84 commit 4eb434f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions scylla/src/transport/connection_pool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ impl PoolRefiller {
req = use_keyspace_request_receiver.recv() => {
if let Some(req) = req {
debug!("[{}] Requested keyspace change: {}", self.endpoint_description(), req.keyspace_name.as_str());
self.use_keyspace(&req.keyspace_name, req.response_sender);
self.use_keyspace(req.keyspace_name, req.response_sender);
} else {
// The keyspace request channel is dropped.
// This means that the corresponding pool is dropped.
Expand Down Expand Up @@ -1077,13 +1077,12 @@ impl PoolRefiller {
// have their keyspace set.
fn use_keyspace(
&mut self,
keyspace_name: &VerifiedKeyspaceName,
keyspace_name: VerifiedKeyspaceName,
response_sender: tokio::sync::oneshot::Sender<Result<(), QueryError>>,
) {
self.current_keyspace = Some(keyspace_name.clone());

let mut conns = self.conns.clone();
let keyspace_name = keyspace_name.clone();
let address = self.endpoint.read().unwrap().address();
let connect_timeout = self.pool_config.connection_config.connect_timeout;

Expand Down

0 comments on commit 4eb434f

Please sign in to comment.