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,8 +49,16 @@ impl Deref for Uuid {
|
||||||
|
|
||||||
impl Uuid {
|
impl Uuid {
|
||||||
/// Generate a new V4 UUID
|
/// Generate a new V4 UUID
|
||||||
|
#[cfg(uuid_unstable)]
|
||||||
pub fn new() -> Self {
|
pub fn new() -> Self {
|
||||||
Self(uuid::Uuid::new_v4())
|
#[cfg(uuid_unstable)]
|
||||||
|
{
|
||||||
|
Self(uuid::Uuid::now_v7())
|
||||||
|
}
|
||||||
|
#[cfg(not(uuid_unstable))]
|
||||||
|
{
|
||||||
|
Self(uuid::Uuid::new_v4())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
/// Generate a new V4 UUID
|
/// Generate a new V4 UUID
|
||||||
pub fn new_v4() -> Self {
|
pub fn new_v4() -> Self {
|
||||||
|
|
Loading…
Reference in a new issue