From f2d18a06ad5825ea9240968d58ed463e4d1e89de Mon Sep 17 00:00:00 2001 From: zaaarf Date: Sat, 9 Mar 2024 19:55:45 +0100 Subject: [PATCH] fix: restored accidentally deleted impls --- src/lib.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/lib.rs b/src/lib.rs index 0a8a202..fb4c737 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -7,6 +7,24 @@ pub mod common { Identity { id: id.to_string() } } } + + impl From<&uuid::Uuid> for Identity { + fn from(id: &uuid::Uuid) -> Self { + Identity { id: id.to_string() } + } + } + + impl From for uuid::Uuid { + fn from(value: Identity) -> Self { + uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity") + } + } + + impl From<&Identity> for uuid::Uuid { + fn from(value: &Identity) -> Self { + uuid::Uuid::parse_str(&value.id).expect("invalid uuid in identity") + } + } } pub mod files {