From f3b5fd3af2d858f15df16ec89cf1d9eaa7819f97 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Fri, 27 Dec 2024 17:48:11 -0800 Subject: [PATCH] Minor refactoring (#2484) --- opentelemetry-sdk/src/logs/log_processor.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/opentelemetry-sdk/src/logs/log_processor.rs b/opentelemetry-sdk/src/logs/log_processor.rs index e46341eb6d..bfcd9e80fd 100644 --- a/opentelemetry-sdk/src/logs/log_processor.rs +++ b/opentelemetry-sdk/src/logs/log_processor.rs @@ -404,13 +404,10 @@ impl BatchLogProcessor { let mut logs = Vec::with_capacity(config.max_export_batch_size); loop { - let remaining_time_option = config + let remaining_time = config .scheduled_delay - .checked_sub(last_export_time.elapsed()); - let remaining_time = match remaining_time_option { - Some(remaining_time) => remaining_time, - None => config.scheduled_delay, - }; + .checked_sub(last_export_time.elapsed()) + .unwrap_or(config.scheduled_delay); match message_receiver.recv_timeout(remaining_time) { Ok(BatchMessage::ExportLog(log)) => {