diff --git a/metrics/src/key.rs b/metrics/src/key.rs index 928ef9d6..73e7eea8 100644 --- a/metrics/src/key.rs +++ b/metrics/src/key.rs @@ -1,5 +1,6 @@ use crate::{atomics::AtomicU64, cow::Cow, IntoLabels, KeyHasher, Label, SharedString}; use std::{ + borrow::Borrow, cmp, fmt, hash::{Hash, Hasher}, slice::Iter, @@ -41,6 +42,13 @@ impl From> for KeyName { KeyName(SharedString::from(name)) } } + +impl Borrow for KeyName { + fn borrow(&self) -> &str { + self.0.borrow() + } +} + /// A metric identifier. /// /// A key represents both the name and labels of a metric.