From<std::borrow::Cow> for KeyName #377
Labels
C-core
Component: core functionality such as traits, etc.
E-simple
Effort: simple.
T-enhancement
Type: enhancement.
T-ergonomics
Type: ergonomics.
We have a use case to have semi-dynamic names for some metrics, and it'd be great if
KeyName
couldimpl From<std::borrow::Cow>
so that we construct the key name once (at runtime) and then cheaply emit metrics using that without reallocating every time. Unless I'm missing something that should be easy enough sinceSharedString
(the crate'sCow
) already hasimpl From<std::borrow::Cow<'static, str>>
. Will be happy to craft a PR for this unless I hear objections. Thanks!The text was updated successfully, but these errors were encountered: