Skip to content

Commit 913c0d6

Browse files
committed
replace once_cell
1 parent 591e311 commit 913c0d6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crates/cuid1/Cargo.toml

+2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
[package]
22
name = "cuid1"
33
version = "0.1.0"
4+
description = "An implementation of the CUID protocol in rust"
5+
documentation = "https://docs.rs/cuid/latest/cuid1/"
46
resolver = "2"
57
edition.workspace = true
68
authors.workspace = true

crates/cuid1/src/lib.rs

+5-3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,11 @@ mod random;
66
mod text;
77
mod time;
88

9-
use once_cell::sync::Lazy;
109
use rand::{thread_rng, Rng};
11-
use std::sync::atomic::{AtomicU32, Ordering};
10+
use std::sync::{
11+
atomic::{AtomicU32, Ordering},
12+
LazyLock,
13+
};
1214

1315
const BASE: u8 = 36;
1416
const BLOCK_SIZE: usize = 4;
@@ -17,7 +19,7 @@ const START_STR: &str = "c";
1719

1820
static COUNTER: AtomicU32 = AtomicU32::new(0);
1921

20-
static FINGERPRINT: Lazy<String> = Lazy::new(fingerprint::fingerprint);
22+
static FINGERPRINT: LazyLock<String> = LazyLock::new(fingerprint::fingerprint);
2123

2224
/// Generate a v1 CUID
2325
///

0 commit comments

Comments
 (0)