Skip to content

Commit

Permalink
Dereference datacenter of type &&str when comparing with &str
Browse files Browse the repository at this point in the history
  • Loading branch information
oeb25 committed Oct 16, 2023
1 parent 36ade9e commit 792c235
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions scylla/src/transport/locator/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit 792c235

Please sign in to comment.