Skip to content

Commit

Permalink
Merge pull request #838 from oeb25/double-ref-str-deref
Browse files Browse the repository at this point in the history
Dereference `datacenter` of type `&&str` when comparing with `&str`
  • Loading branch information
Lorak-mmk authored Oct 17, 2023
2 parents 9c12237 + 792c235 commit 3a26efc
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 3a26efc

Please sign in to comment.