From e6467a220f4cc37bdbba49ad54274b9a97c93081 Mon Sep 17 00:00:00 2001 From: Sreekanth Date: Fri, 17 Jan 2025 12:25:53 +0530 Subject: [PATCH] Refactoring Signed-off-by: Sreekanth --- rust/numaflow-core/src/tracker.rs | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/rust/numaflow-core/src/tracker.rs b/rust/numaflow-core/src/tracker.rs index 158882012..919ab5d26 100644 --- a/rust/numaflow-core/src/tracker.rs +++ b/rust/numaflow-core/src/tracker.rs @@ -346,14 +346,16 @@ impl TrackerHandle { offset: Bytes, message_tags: Option>, ) -> Result<()> { - let mut responses: Option> = None; - if self.enable_callbacks { - if let Some(tags) = message_tags { + let responses: Option> = match (self.enable_callbacks, message_tags) { + (true, Some(tags)) => { if !tags.is_empty() { - responses = Some(tags.iter().cloned().collect()); + Some(tags.iter().cloned().collect::>()) + } else { + None } - }; - } + } + _ => None, + }; let message = ActorMessage::Update { offset, responses }; self.sender .send(message)