From 4eb434f78c2168cbb27195be94c515c3137afae2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Karol=20Bary=C5=82a?= Date: Sat, 7 Dec 2024 09:47:51 +0100 Subject: [PATCH] refiller: Remove unnecessary clone 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. --- scylla/src/transport/connection_pool.rs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/scylla/src/transport/connection_pool.rs b/scylla/src/transport/connection_pool.rs index 54d70c0eb..4b3de60c5 100644 --- a/scylla/src/transport/connection_pool.rs +++ b/scylla/src/transport/connection_pool.rs @@ -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. @@ -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>, ) { 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;