Use UUIDv7 as default UUID type
This commit is contained in:
parent
30953bc2a3
commit
996b9c1375
1 changed files with 9 additions and 1 deletions
|
@ -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())
|
||||
|
|
Loading…
Reference in a new issue