Use UUIDv7 as default UUID type

This commit is contained in:
Tobie Morgan Hitchcock 2023-01-17 09:51:58 +00:00
parent 30953bc2a3
commit 996b9c1375

View file

@ -49,9 +49,17 @@ impl Deref for Uuid {
impl Uuid {
/// Generate a new V4 UUID
#[cfg(uuid_unstable)]
pub fn new() -> Self {
#[cfg(uuid_unstable)]
{
Self(uuid::Uuid::now_v7())
}
#[cfg(not(uuid_unstable))]
{
Self(uuid::Uuid::new_v4())
}
}
/// Generate a new V4 UUID
pub fn new_v4() -> Self {
Self(uuid::Uuid::new_v4())