diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2021-07-06 23:48:01 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-06 23:48:01 -0400 |
commit | 7fc0e8ec8cd4b18ba10a04cf0ac2bee48826de3d (patch) | |
tree | 70e078538ae0f3467e8a519b918ae936587ce2d4 /cli/file_fetcher.rs | |
parent | 78ac19f51f48984ea16f97a0c574fa507544b8d5 (diff) |
chore: use parking_lot for synchronization primitives to align with tokio (#11289)
parking_lot is already transitively used in tokio via the "full" cargo feature
Diffstat (limited to 'cli/file_fetcher.rs')
-rw-r--r-- | cli/file_fetcher.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/file_fetcher.rs b/cli/file_fetcher.rs index a326d130e..61cf1dae6 100644 --- a/cli/file_fetcher.rs +++ b/cli/file_fetcher.rs @@ -17,6 +17,7 @@ use deno_core::error::uri_error; use deno_core::error::AnyError; use deno_core::futures; use deno_core::futures::future::FutureExt; +use deno_core::parking_lot::Mutex; use deno_core::ModuleSpecifier; use deno_runtime::deno_fetch::reqwest; use deno_runtime::deno_web::BlobStore; @@ -32,7 +33,6 @@ use std::io::Read; use std::path::PathBuf; use std::pin::Pin; use std::sync::Arc; -use std::sync::Mutex; static DENO_AUTH_TOKENS: &str = "DENO_AUTH_TOKENS"; pub const SUPPORTED_SCHEMES: [&str; 5] = @@ -64,12 +64,12 @@ struct FileCache(Arc<Mutex<HashMap<ModuleSpecifier, File>>>); impl FileCache { pub fn get(&self, specifier: &ModuleSpecifier) -> Option<File> { - let cache = self.0.lock().unwrap(); + let cache = self.0.lock(); cache.get(specifier).cloned() } pub fn insert(&self, specifier: ModuleSpecifier, file: File) -> Option<File> { - let mut cache = self.0.lock().unwrap(); + let mut cache = self.0.lock(); cache.insert(specifier, file) } } |