Skip to content

Commit

Permalink
Allow Id creation from non-String types
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantGryczan committed Dec 22, 2024
1 parent 179b01c commit 4621b50
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/id.rs
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,12 @@ impl<T: AsRef<[u8]>> Display for Id<T> {
}
}

impl<T> From<T> for Id<T> {
fn from(value: T) -> Self {
Self(value)
}
}

/// An error constructing an [`Id`].
#[derive(Error, Clone, Debug)]
#[non_exhaustive]
Expand Down

0 comments on commit 4621b50

Please sign in to comment.