From 9c788d9d215472a0c0a1a2bec20d2f85cba8e3ca Mon Sep 17 00:00:00 2001 From: Tobie Morgan Hitchcock Date: Tue, 25 Oct 2022 15:17:21 -0700 Subject: [PATCH] Ensure unstable UUID functions are behind a build flag --- lib/src/fnc/rand.rs | 1 + lib/src/sql/uuid.rs | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/src/fnc/rand.rs b/lib/src/fnc/rand.rs index b6c6aa91..b28e222e 100644 --- a/lib/src/fnc/rand.rs +++ b/lib/src/fnc/rand.rs @@ -134,6 +134,7 @@ pub mod uuid { Ok(Uuid::new_v4().into()) } + #[cfg(uuid_unstable)] pub fn v7(_: ()) -> Result { Ok(Uuid::new_v7().into()) } diff --git a/lib/src/sql/uuid.rs b/lib/src/sql/uuid.rs index f2d938a3..7c777e47 100644 --- a/lib/src/sql/uuid.rs +++ b/lib/src/sql/uuid.rs @@ -51,6 +51,7 @@ impl Uuid { Self(uuid::Uuid::new_v4()) } /// Generate a new V7 UUID + #[cfg(uuid_unstable)] pub fn new_v7() -> Self { Self(uuid::Uuid::now_v7()) }