diff --git a/Cargo.toml b/Cargo.toml index 99d3ede..07c49d5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -22,10 +22,10 @@ path = "src/lib.rs" [dependencies] clap = { version = "2.33.0", optional = true } -lazy_static = "1.4.0" num-rational = "0.2.3" num-bigint = "0.2.6" num-traits = "0.2.11" +once_cell = "1.3.1" [features] default = ["commandline"] diff --git a/src/builtin/mod.rs b/src/builtin/mod.rs index cb61dc9..91e748b 100644 --- a/src/builtin/mod.rs +++ b/src/builtin/mod.rs @@ -1,4 +1,4 @@ -use lazy_static::lazy_static; +use once_cell::sync::Lazy; use std::collections::HashMap; use crate::args::CallArgs; @@ -19,14 +19,12 @@ mod string; pub(crate) type Builtin = Box SassResult + Send + Sync>; -lazy_static! { - pub(crate) static ref GLOBAL_FUNCTIONS: HashMap = { - let mut m = HashMap::new(); - color::register(&mut m); - list::register(&mut m); - math::register(&mut m); - meta::register(&mut m); - string::register(&mut m); - m - }; -} +pub(crate) static GLOBAL_FUNCTIONS: Lazy> = Lazy::new(|| { + let mut m = HashMap::new(); + color::register(&mut m); + list::register(&mut m); + math::register(&mut m); + meta::register(&mut m); + string::register(&mut m); + m +});