Skip to content

Commit

Permalink
Replace lazy_static with once_cell
Browse files Browse the repository at this point in the history
Fixes #16
  • Loading branch information
steinbro authored and Eh2406 committed Oct 20, 2023
1 parent dd71aa2 commit a1e8c5c
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 14 deletions.
12 changes: 3 additions & 9 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ winres = "0.1.12"

[dev-dependencies]
quickcheck = "1.0.3"
lazy_static = "1.4.0"
once_cell = "1.18.0"

[profile.release]
debug = true
Expand Down
7 changes: 4 additions & 3 deletions src/clean_text/test.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use once_cell::sync::Lazy;
use super::*;
use quickcheck::quickcheck;

lazy_static! {
pub static ref RE_LIST: Vec<RegexCleanerPair> = crate::settings::Settings::new().cleaners;
}
pub static RE_LIST: Lazy<Vec<RegexCleanerPair>> = Lazy::new(|| {
crate::settings::Settings::new().cleaners
});

pub fn clean_text_string<T: AsRef<str>>(raw: T, list: &[RegexCleanerPair]) -> String {
clean_text(raw.as_ref(), list)
Expand Down
1 change: 0 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use windows::Win32::{

#[cfg(test)]
#[macro_use]
extern crate lazy_static;
mod wide_string;
mod window;
use crate::window::*;
Expand Down

0 comments on commit a1e8c5c

Please sign in to comment.