Replace lazy_static and OnceLock with LazyLock
This commit is contained in:
@@ -13,7 +13,6 @@ serde = { version = "1.0", features = ["derive"]}
|
||||
bincode = "1.3.3"
|
||||
nohash = "0.2.0"
|
||||
ahash = "0.8.3"
|
||||
lazy_static = "1.4"
|
||||
whatlang = "0.16" # Language detection
|
||||
rust-stemmers = "1.2" # Stemmers
|
||||
tinysegmenter = "0.1" # Japanese tokenizer
|
||||
|
||||
@@ -4,16 +4,13 @@
|
||||
* SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-SEL
|
||||
*/
|
||||
|
||||
use std::{borrow::Cow, vec::IntoIter};
|
||||
use std::{borrow::Cow, sync::LazyLock, vec::IntoIter};
|
||||
|
||||
use jieba_rs::Jieba;
|
||||
|
||||
use super::{InnerToken, Token};
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
lazy_static! {
|
||||
pub static ref JIEBA: Jieba = Jieba::new();
|
||||
}
|
||||
pub(crate) static JIEBA: LazyLock<Jieba> = LazyLock::new(Jieba::new);
|
||||
|
||||
pub struct ChineseTokenizer<'x, T, I>
|
||||
where
|
||||
|
||||
Reference in New Issue
Block a user