Skip to content

Commit 3ca5952

Browse files
committed
Avoid eager clone
1 parent 002a74f commit 3ca5952

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

crates/sui-data-ingestion-core/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ pub trait Worker: Send + Sync {
3030
type Result: Send + Sync + Clone;
3131
async fn process_checkpoint_arc(
3232
&self,
33-
checkpoint: Arc<CheckpointData>,
33+
checkpoint: &Arc<CheckpointData>,
3434
) -> Result<Self::Result> {
35-
self.process_checkpoint(&checkpoint).await
35+
self.process_checkpoint(checkpoint).await
3636
}
3737
/// There is no need to implement this if you implement process_checkpoint_arc. The WorkerPool
3838
/// will only call process_checkpoint_arc. This method was left in place for backwards

crates/sui-data-ingestion-core/src/worker_pool.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ impl<W: Worker + 'static> WorkerPool<W> {
8484
let result = backoff::future::retry(backoff, || async {
8585
worker
8686
.clone()
87-
.process_checkpoint_arc(checkpoint.clone())
87+
.process_checkpoint_arc(&checkpoint)
8888
.await
8989
.map_err(|err| {
9090
info!("transient worker execution error {:?} for checkpoint {}", err, sequence_number);

0 commit comments

Comments
 (0)