Skip to content

Commit

Permalink
a little more cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
tobz committed Sep 21, 2024
1 parent d75265a commit 599949e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions metrics/src/recorder/mod.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{cell::Cell, ops::Deref, ptr::NonNull, sync::Arc};
use std::{cell::Cell, ptr::NonNull};

mod cell;
use self::cell::RecorderOnceCell;
Expand Down Expand Up @@ -70,7 +70,7 @@ macro_rules! impl_recorder {
unit: Option<$crate::Unit>,
description: $crate::SharedString,
) {
Deref::deref(self).describe_counter(key, unit, description)
std::ops::Deref::deref(self).describe_counter(key, unit, description)
}

fn describe_gauge(
Expand All @@ -79,7 +79,7 @@ macro_rules! impl_recorder {
unit: Option<$crate::Unit>,
description: $crate::SharedString,
) {
Deref::deref(self).describe_gauge(key, unit, description)
std::ops::Deref::deref(self).describe_gauge(key, unit, description)
}

fn describe_histogram(
Expand All @@ -88,40 +88,40 @@ macro_rules! impl_recorder {
unit: Option<$crate::Unit>,
description: $crate::SharedString,
) {
Deref::deref(self).describe_histogram(key, unit, description)
std::ops::Deref::deref(self).describe_histogram(key, unit, description)
}

fn register_counter(
&self,
key: &$crate::Key,
metadata: &$crate::Metadata<'_>,
) -> $crate::Counter {
Deref::deref(self).register_counter(key, metadata)
std::ops::Deref::deref(self).register_counter(key, metadata)
}

fn register_gauge(
&self,
key: &$crate::Key,
metadata: &$crate::Metadata<'_>,
) -> $crate::Gauge {
Deref::deref(self).register_gauge(key, metadata)
std::ops::Deref::deref(self).register_gauge(key, metadata)
}

fn register_histogram(
&self,
key: &$crate::Key,
metadata: &$crate::Metadata<'_>,
) -> $crate::Histogram {
Deref::deref(self).register_histogram(key, metadata)
std::ops::Deref::deref(self).register_histogram(key, metadata)
}
}
};
}

impl_recorder!(T, &T);
impl_recorder!(T, &mut T);
impl_recorder!(T, Box<T>);
impl_recorder!(T, Arc<T>);
impl_recorder!(T, std::boxed::Box<T>);
impl_recorder!(T, std::sync::Arc<T>);

/// Guard for setting a local recorder.
///
Expand Down

0 comments on commit 599949e

Please sign in to comment.