From 792c235b678e7febe45ba0fa114621a73d68b647 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Oliver=20B=C3=B8ving?= Date: Mon, 16 Oct 2023 11:31:56 +0200 Subject: [PATCH] Dereference `datacenter` of type `&&str` when comparing with `&str` --- scylla/src/transport/locator/mod.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scylla/src/transport/locator/mod.rs b/scylla/src/transport/locator/mod.rs index db55b9fe69..4ff44891d1 100644 --- a/scylla/src/transport/locator/mod.rs +++ b/scylla/src/transport/locator/mod.rs @@ -275,7 +275,7 @@ impl<'a> ReplicaSet<'a> { datacenter, } => replicas .iter() - .filter(|node| node.datacenter.as_deref() == Some(datacenter)) + .filter(|node| node.datacenter.as_deref() == Some(*datacenter)) .count(), ReplicaSetInner::ChainedNTS { datacenter_repfactors, @@ -317,7 +317,7 @@ impl<'a> ReplicaSet<'a> { datacenter, } => replicas .iter() - .filter(|node| node.datacenter.as_deref() == Some(datacenter)) + .filter(|node| node.datacenter.as_deref() == Some(*datacenter)) .nth(index), ReplicaSetInner::ChainedNTS { datacenter_repfactors, @@ -466,7 +466,7 @@ impl<'a> Iterator for ReplicaSetIterator<'a> { } => { while let Some(replica) = replicas.get(*idx) { *idx += 1; - if replica.datacenter.as_deref() == Some(datacenter) { + if replica.datacenter.as_deref() == Some(*datacenter) { return Some(replica); } }