Skip to content

Offline, privacy-first grammar checker. Fast, open-source, Rust-powered

refactor: `once_cell`→`LazyLock` (#2942)

Andrew Dunbar1d8fd92e76b4
diff --git a/Cargo.lock b/Cargo.lock
index cb5b6ed0d..47c0cac66 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -2806,7 +2806,6 @@ dependencies = [
"itertools 0.14.0",
"levenshtein_automata",
"lru",
- "once_cell",
"ordered-float 5.1.0",
"paste",
"pulldown-cmark",
diff --git a/harper-core/Cargo.toml b/harper-core/Cargo.toml
index 0490802f2..fadc03c0f 100644
--- a/harper-core/Cargo.toml
+++ b/harper-core/Cargo.toml
@@ -42,7 +42,6 @@ criterion = { version = "0.8.2", default-features = false }
rand = "0.8.5"
quickcheck = "1.1.0"
quickcheck_macros = "1.2.0"
-once_cell = "1.21.3"
rayon = "1.11.0"
[[bench]]
diff --git a/harper-core/src/spell/rune/mod.rs b/harper-core/src/spell/rune/mod.rs
index 7fc48dd55..3dcdaa258 100644
--- a/harper-core/src/spell/rune/mod.rs
+++ b/harper-core/src/spell/rune/mod.rs
@@ -13,8 +13,8 @@ pub use self::word_list::parse_word_list;
#[cfg(test)]
mod tests {
use hashbrown::HashSet;
- use once_cell::sync::Lazy;
use serde_json::json;
+ use std::sync::LazyLock;
use super::super::word_map::WordMap;
use super::word_list::parse_word_list;
@@ -30,7 +30,7 @@ mod tests {
pub const TEST_WORD_LIST_WITH_COMMENTS: &str = "4\nhello # a word without attributes\ntry/B \t # a word with empty attributes\nwork/AB\t #a word with one attribute\nblank/ #a word with two attributes";
- pub static TEST_AFFIX_JSON: Lazy<serde_json::Value> = Lazy::new(|| {
+ pub static TEST_AFFIX_JSON: LazyLock<serde_json::Value> = LazyLock::new(|| {
json!({
"affixes": {
"A": {