diff --git a/src/config.rs b/src/config.rs index 07dee8b3f..ed1d38ba2 100644 --- a/src/config.rs +++ b/src/config.rs @@ -37,7 +37,7 @@ pub use crate::cache::PreprocessorCacheModeConfig; use crate::errors::*; static CACHED_CONFIG_PATH: Lazy = Lazy::new(CachedConfig::file_config_path); -static CACHED_CONFIG: Lazy>> = Lazy::new(|| Mutex::new(None)); +static CACHED_CONFIG: Mutex> = Mutex::new(None); const ORGANIZATION: &str = "Mozilla"; const APP_NAME: &str = "sccache"; diff --git a/src/dist/client_auth.rs b/src/dist/client_auth.rs index 573de1dea..cfe506106 100644 --- a/src/dist/client_auth.rs +++ b/src/dist/client_auth.rs @@ -89,7 +89,6 @@ mod code_grant_pkce { use base64::Engine; use futures::channel::oneshot; use hyper::{Body, Method, Request, Response, StatusCode}; - use once_cell::sync::Lazy; use rand::{rngs::OsRng, RngCore}; use serde::{Deserialize, Serialize}; use sha2::{Digest, Sha256}; @@ -142,7 +141,7 @@ mod code_grant_pkce { pub shutdown_tx: Option>, } - pub static STATE: Lazy>> = Lazy::new(|| Mutex::new(None)); + pub static STATE: Mutex> = Mutex::new(None); pub fn generate_verifier_and_challenge() -> Result<(String, String)> { let mut code_verifier_bytes = vec![0; NUM_CODE_VERIFIER_BYTES]; @@ -279,7 +278,6 @@ mod implicit { }; use futures::channel::oneshot; use hyper::{Body, Method, Request, Response, StatusCode}; - use once_cell::sync::Lazy; use std::collections::HashMap; use std::sync::mpsc; use std::sync::Mutex; @@ -308,7 +306,7 @@ mod implicit { pub shutdown_tx: Option>, } - pub static STATE: Lazy>> = Lazy::new(|| Mutex::new(None)); + pub static STATE: Mutex> = Mutex::new(None); pub fn finish_url(client_id: &str, url: &mut Url, redirect_uri: &str, state: &str) { url.query_pairs_mut()