Ensure unstable UUID functions are behind a build flag

This commit is contained in:
Tobie Morgan Hitchcock 2022-10-25 15:17:21 -07:00
parent f32fb516eb
commit 9c788d9d21
2 changed files with 2 additions and 0 deletions

View file

@ -134,6 +134,7 @@ pub mod uuid {
Ok(Uuid::new_v4().into()) Ok(Uuid::new_v4().into())
} }
#[cfg(uuid_unstable)]
pub fn v7(_: ()) -> Result<Value, Error> { pub fn v7(_: ()) -> Result<Value, Error> {
Ok(Uuid::new_v7().into()) Ok(Uuid::new_v7().into())
} }

View file

@ -51,6 +51,7 @@ impl Uuid {
Self(uuid::Uuid::new_v4()) Self(uuid::Uuid::new_v4())
} }
/// Generate a new V7 UUID /// Generate a new V7 UUID
#[cfg(uuid_unstable)]
pub fn new_v7() -> Self { pub fn new_v7() -> Self {
Self(uuid::Uuid::now_v7()) Self(uuid::Uuid::now_v7())
} }