Skip to content

Commit 9b0806a

Browse files
Replace lazy_static with LazyLock in style_config crate (#138)
* Replace lazy_static with LazyLock in style_config crate Signed-off-by: Nico Burns <[email protected]> * Remove needed closure Co-authored-by: Oriol Brufau <[email protected]> Signed-off-by: Nico Burns <[email protected]> --------- Signed-off-by: Nico Burns <[email protected]> Co-authored-by: Oriol Brufau <[email protected]>
1 parent 940d249 commit 9b0806a

File tree

2 files changed

+2
-9
lines changed

2 files changed

+2
-9
lines changed

stylo_config/Cargo.toml

-3
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,3 @@ edition = "2021"
1212
[lib]
1313
name = "stylo_config"
1414
path = "lib.rs"
15-
16-
[dependencies]
17-
lazy_static = "1.4"

stylo_config/lib.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,9 @@
33
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
44

55
use std::collections::HashMap;
6-
use std::sync::RwLock;
6+
use std::sync::{LazyLock, RwLock};
77

8-
use lazy_static::lazy_static;
9-
10-
lazy_static! {
11-
static ref PREFS: Preferences = Preferences::default();
12-
}
8+
static PREFS: LazyLock<Preferences> = LazyLock::new(Preferences::default);
139

1410
#[derive(Debug, Default)]
1511
pub struct Preferences {

0 commit comments

Comments
 (0)