Skip to content

Commit 20d207f

Browse files
authored
Impl From<std::borrow::Cow> for KeyName (#378)
1 parent a4b2fc1 commit 20d207f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

metrics/src/key.rs

+6
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,12 @@ impl From<String> for KeyName {
3535
KeyName(SharedString::from(name))
3636
}
3737
}
38+
39+
impl From<std::borrow::Cow<'static, str>> for KeyName {
40+
fn from(name: std::borrow::Cow<'static, str>) -> Self {
41+
KeyName(SharedString::from(name))
42+
}
43+
}
3844
/// A metric identifier.
3945
///
4046
/// A key represents both the name and labels of a metric.

0 commit comments

Comments
 (0)