Skip to content

Commit

Permalink
feat: accept impl<Into<T>> in EnumLabel constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
xDarksome committed Jul 1, 2024
1 parent b9d0c85 commit c0a6ad2
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions crates/metrics/src/label.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,8 +67,8 @@ pub struct EnumLabel<const NAME: LabelName, T>(T);

impl<const NAME: LabelName, T> EnumLabel<NAME, T> {
/// Creates a new [`EnumLabel`].
pub fn new(e: T) -> Self {
Self(e)
pub fn new(e: impl Into<T>) -> Self {
Self(e.into())
}

/// Convert this [`EnumLabel`] into the inner [`Enum`].
Expand Down

0 comments on commit c0a6ad2

Please sign in to comment.