From 506a4f9fb2253d2415a2ec1018732177c602ab16 Mon Sep 17 00:00:00 2001 From: Utkarsh Umesan Pillai <66651184+utpilla@users.noreply.github.com> Date: Mon, 2 Dec 2024 20:01:35 -0800 Subject: [PATCH] [Metrics] Remove unnecessary box (#2376) Co-authored-by: Cijo Thomas --- opentelemetry-sdk/src/metrics/manual_reader.rs | 6 +++--- opentelemetry-sdk/src/metrics/pipeline.rs | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/opentelemetry-sdk/src/metrics/manual_reader.rs b/opentelemetry-sdk/src/metrics/manual_reader.rs index 639469a5a1..652bf19a35 100644 --- a/opentelemetry-sdk/src/metrics/manual_reader.rs +++ b/opentelemetry-sdk/src/metrics/manual_reader.rs @@ -27,7 +27,7 @@ use super::{ /// # drop(reader) /// ``` pub struct ManualReader { - inner: Box>, + inner: Mutex, temporality: Temporality, } @@ -58,10 +58,10 @@ impl ManualReader { /// A [MetricReader] which is directly called to collect metrics. pub(crate) fn new(temporality: Temporality) -> Self { ManualReader { - inner: Box::new(Mutex::new(ManualReaderInner { + inner: Mutex::new(ManualReaderInner { sdk_producer: None, is_shutdown: false, - })), + }), temporality, } } diff --git a/opentelemetry-sdk/src/metrics/pipeline.rs b/opentelemetry-sdk/src/metrics/pipeline.rs index add9ba16dc..8fb94c289f 100644 --- a/opentelemetry-sdk/src/metrics/pipeline.rs +++ b/opentelemetry-sdk/src/metrics/pipeline.rs @@ -37,7 +37,7 @@ pub struct Pipeline { pub(crate) resource: Resource, reader: Box, views: Vec>, - inner: Box>, + inner: Mutex, } impl fmt::Debug for Pipeline {