From 4621b50158f430842fc5979fa79f3b15ba1b86f2 Mon Sep 17 00:00:00 2001 From: Grant Gryczan Date: Sun, 22 Dec 2024 18:41:32 -0500 Subject: [PATCH] Allow `Id` creation from non-`String` types --- src/id.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/id.rs b/src/id.rs index 5e94d6b..ae77db2 100644 --- a/src/id.rs +++ b/src/id.rs @@ -69,6 +69,12 @@ impl> Display for Id { } } +impl From for Id { + fn from(value: T) -> Self { + Self(value) + } +} + /// An error constructing an [`Id`]. #[derive(Error, Clone, Debug)] #[non_exhaustive]