diff --git a/src/uuid.rs b/src/uuid.rs index 374601e..5a2bcd9 100644 --- a/src/uuid.rs +++ b/src/uuid.rs @@ -33,6 +33,12 @@ pub struct Uuid([u8; 16]); // 15 | impl Uuid { + #[inline] + #[must_use] + pub const fn nil() -> Self { + Self([0; 16]) + } + #[inline] #[must_use] pub const fn from_bytes(bytes: [u8; 16]) -> Self { @@ -62,6 +68,13 @@ impl Uuid { } } +impl Default for Uuid { + #[inline] + fn default() -> Self { + Self::nil() + } +} + impl str::FromStr for Uuid { type Err = ParseError;