Skip to content

Commit 3379c0d

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 3bb9a49 commit 3379c0d

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
@@ -55,9 +55,9 @@ impl LoadBalancingConfig {
5555
builder =
5656
builder.enable_shuffling_replicas(self.token_aware_shuffling_replicas_enabled);
5757
}
58-
if let Some(dc_awareness) = self.dc_awareness.as_ref() {
58+
if let Some(dc_awareness) = self.dc_awareness {
5959
builder = builder
60-
.prefer_datacenter(dc_awareness.local_dc.clone())
60+
.prefer_datacenter(dc_awareness.local_dc)
6161
.permit_dc_failover(true)
6262
}
6363
if self.latency_awareness_enabled {

0 commit comments

Comments
 (0)