From e01babffab1dbfa1dc512d616ef8378c5cd9c66d Mon Sep 17 00:00:00 2001 From: Arnaud Gourlay Date: Wed, 3 Dec 2025 13:53:17 +0100 Subject: [PATCH] Cleanup a few clones (#7681) --- lib/collection/src/collection/clean.rs | 2 +- lib/collection/src/collection_manager/segments_searcher.rs | 1 - lib/collection/src/update_handler.rs | 4 ++-- lib/shard/src/proxy_segment/segment_entry.rs | 4 ++-- src/common/inference/inference_input.rs | 6 +++--- 5 files changed, 8 insertions(+), 9 deletions(-) diff --git a/lib/collection/src/collection/clean.rs b/lib/collection/src/collection/clean.rs index 1ae87354c4..861b518892 100644 --- a/lib/collection/src/collection/clean.rs +++ b/lib/collection/src/collection/clean.rs @@ -206,7 +206,7 @@ impl ShardCleanTask { ShardCleanTask { handle: task, - status: receiver.clone(), + status: receiver, cancel: cancel.drop_guard(), } } diff --git a/lib/collection/src/collection_manager/segments_searcher.rs b/lib/collection/src/collection_manager/segments_searcher.rs index f3e367d9bb..ebdaf664ad 100644 --- a/lib/collection/src/collection_manager/segments_searcher.rs +++ b/lib/collection/src/collection_manager/segments_searcher.rs @@ -433,7 +433,6 @@ impl SegmentsSearcher { .non_appendable_then_appendable_segments() .map(|segment| { let handle = runtime_handle.spawn_blocking({ - let segment = segment.clone(); let arc_ctx = arc_ctx.clone(); let hw_counter = hw_measurement_acc.get_counter_cell(); move || { diff --git a/lib/collection/src/update_handler.rs b/lib/collection/src/update_handler.rs index 8e087067dd..73c99d2ca6 100644 --- a/lib/collection/src/update_handler.rs +++ b/lib/collection/src/update_handler.rs @@ -793,8 +793,8 @@ impl UpdateHandler { &segments, op_num, operation, - update_operation_lock.clone(), - update_tracker.clone(), + update_operation_lock, + update_tracker, &hw_measurements.get_counter_cell(), ); diff --git a/lib/shard/src/proxy_segment/segment_entry.rs b/lib/shard/src/proxy_segment/segment_entry.rs index 458fe13824..03112160c9 100644 --- a/lib/shard/src/proxy_segment/segment_entry.rs +++ b/lib/shard/src/proxy_segment/segment_entry.rs @@ -131,7 +131,7 @@ impl SegmentEntry for ProxySegment { .wrapped_segment .get() .read() - .rescore_with_formula(formula_ctx.clone(), hw_counter)?; + .rescore_with_formula(formula_ctx, hw_counter)?; let result = { if self.deleted_points.is_empty() { @@ -716,7 +716,7 @@ impl SegmentEntry for ProxySegment { // Store index change to later propagate to optimized/wrapped segment self.changed_indexes - .insert(key.clone(), ProxyIndexChange::Create(field_schema, op_num)); + .insert(key, ProxyIndexChange::Create(field_schema, op_num)); Ok(true) } diff --git a/src/common/inference/inference_input.rs b/src/common/inference/inference_input.rs index 3edabdcb66..2a273692dd 100644 --- a/src/common/inference/inference_input.rs +++ b/src/common/inference/inference_input.rs @@ -47,7 +47,7 @@ impl From for InferenceInput { InferenceInput { data: Value::String(text), data_type: InferenceDataType::Text, - model: model.clone(), + model, options: options.map(DocumentOptions::into_options), } } @@ -60,7 +60,7 @@ impl From for InferenceInput { InferenceInput { data: image, data_type: InferenceDataType::Image, - model: model.clone(), + model, options: options.options, } } @@ -73,7 +73,7 @@ impl From for InferenceInput { InferenceInput { data: object, data_type: InferenceDataType::Object, - model: model.clone(), + model, options: options.options, } }