From 11a1fba86a0bd178a45b3d492809f6d5b06dca90 Mon Sep 17 00:00:00 2001 From: Lijun Wang <83639177+lijunwangs@users.noreply.github.com> Date: Thu, 3 Oct 2024 01:37:08 -0700 Subject: [PATCH] Pass reference instead of copy --- turbine/src/retransmit_stage.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/turbine/src/retransmit_stage.rs b/turbine/src/retransmit_stage.rs index 30cdccb98d15fd..b5e67cd3203a40 100644 --- a/turbine/src/retransmit_stage.rs +++ b/turbine/src/retransmit_stage.rs @@ -185,7 +185,7 @@ fn retransmit( shred_deduper: &mut ShredDeduper<2>, max_slots: &MaxSlots, rpc_subscriptions: Option<&RpcSubscriptions>, - slot_status_notifier: Option, + slot_status_notifier: Option<&SlotStatusNotifier>, ) -> Result<(), RecvTimeoutError> { const RECV_TIMEOUT: Duration = Duration::from_secs(1); let mut shreds = shreds_receiver.recv_timeout(RECV_TIMEOUT)?; @@ -420,7 +420,7 @@ pub fn retransmitter( &mut shred_deduper, &max_slots, rpc_subscriptions.as_deref(), - slot_status_notifier.clone(), + slot_status_notifier.as_ref(), ) { Ok(()) => (), Err(RecvTimeoutError::Timeout) => (), @@ -518,7 +518,7 @@ impl RetransmitStats { feed: I, root: Slot, rpc_subscriptions: Option<&RpcSubscriptions>, - slot_status_notifier: Option, + slot_status_notifier: Option<&SlotStatusNotifier>, ) where I: IntoIterator, { @@ -536,7 +536,7 @@ impl RetransmitStats { } } - if let Some(slot_status_notifier) = &slot_status_notifier { + if let Some(slot_status_notifier) = slot_status_notifier { if slot > root { slot_status_notifier .read()