Skip to content

Commit 7b8572a

Browse files
committed
lbp_config: remove needless string allocation
`self` is consumed by this method, thus there is no need to match dc_awareness by reference and to clone a local_dc string.
1 parent 94b6d16 commit 7b8572a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scylla-rust-wrapper/src/cluster.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,9 @@ impl LoadBalancingConfig {
6565
builder =
6666
builder.enable_shuffling_replicas(self.token_aware_shuffling_replicas_enabled);
6767
}
68-
if let Some(dc_awareness) = self.dc_awareness.as_ref() {
68+
if let Some(dc_awareness) = self.dc_awareness {
6969
builder = builder
70-
.prefer_datacenter(dc_awareness.local_dc.clone())
70+
.prefer_datacenter(dc_awareness.local_dc)
7171
.permit_dc_failover(true)
7272
}
7373
if self.latency_awareness_enabled {

0 commit comments

Comments
 (0)