From 648bef3b3baca12b35ce4b673356b6011163bc1b Mon Sep 17 00:00:00 2001 From: Jonathan Schwender Date: Tue, 10 Dec 2024 09:20:20 +0100 Subject: [PATCH] Remove lazy_static dependency Mutex can now be constructed in const contexts, so we don't need to lazily construct it anymore. --- Cargo.toml | 1 - src/lib.rs | 2 -- src/shaders/mod.rs | 4 +--- 3 files changed, 1 insertion(+), 6 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index ebc7234d0..6ca0e5488 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,6 @@ readme = "README.md" [dependencies] libz-sys = { version = "1.1", optional = true } -lazy_static = "1.0" [dev-dependencies] dlopen = "0.1" diff --git a/src/lib.rs b/src/lib.rs index 01af651fe..c95ade524 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,5 +1,3 @@ -#[macro_use] -extern crate lazy_static; // This extern crates are needed for linking #[cfg(test)] extern crate dlopen; diff --git a/src/shaders/mod.rs b/src/shaders/mod.rs index b24a2b505..6603c0353 100644 --- a/src/shaders/mod.rs +++ b/src/shaders/mod.rs @@ -21,9 +21,7 @@ use std::slice; use std::str; use std::sync::Mutex; -lazy_static! { - static ref CONSTRUCT_COMPILER_LOCK: Mutex<()> = Mutex::new(()); -} +static CONSTRUCT_COMPILER_LOCK: Mutex<()> = Mutex::new(()); pub fn initialize() -> Result<(), &'static str> { if unsafe { GLSLangInitialize() } == 0 {