Skip to content

Commit

Permalink
Add conversion for uuid from u128
Browse files Browse the repository at this point in the history
  • Loading branch information
ya7on committed Feb 25, 2024
1 parent 2098361 commit 3c95504
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/types/uuid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ impl From<MCUuid> for Uuid {
}
}

impl From<u128> for MCUuid {
fn from(value: u128) -> Self {
Self(Uuid::from_u128(value))
}
}

impl PartialEq<Uuid> for MCUuid {
fn eq(&self, other: &Uuid) -> bool {
&self.0 == other
Expand Down

0 comments on commit 3c95504

Please sign in to comment.