Skip to content

Commit

Permalink
Impl From<std::borrow::Cow> for KeyName (#378)
Browse files Browse the repository at this point in the history
  • Loading branch information
mooso authored Jun 13, 2023
1 parent a4b2fc1 commit 20d207f
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions metrics/src/key.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,12 @@ impl From<String> for KeyName {
KeyName(SharedString::from(name))
}
}

impl From<std::borrow::Cow<'static, str>> for KeyName {
fn from(name: std::borrow::Cow<'static, str>) -> Self {
KeyName(SharedString::from(name))
}
}
/// A metric identifier.
///
/// A key represents both the name and labels of a metric.
Expand Down

0 comments on commit 20d207f

Please sign in to comment.