diff --git a/crates/mun_hir/Cargo.toml b/crates/mun_hir/Cargo.toml index 5150e670c..3faad5680 100644 --- a/crates/mun_hir/Cargo.toml +++ b/crates/mun_hir/Cargo.toml @@ -21,3 +21,4 @@ either = "1.5.3" [dev-dependencies] insta = "0.12.0" +parking_lot = "0.10" diff --git a/crates/mun_hir/src/mock.rs b/crates/mun_hir/src/mock.rs index 3a8cf9a69..4af824cbd 100644 --- a/crates/mun_hir/src/mock.rs +++ b/crates/mun_hir/src/mock.rs @@ -1,7 +1,8 @@ use crate::db::SourceDatabase; use crate::input::{SourceRoot, SourceRootId}; use crate::{FileId, RelativePathBuf}; -use std::sync::{Arc, Mutex}; +use parking_lot::Mutex; +use std::sync::Arc; /// A mock implementation of the IR database. It can be used to set up a simple test case. #[salsa::database( @@ -21,7 +22,7 @@ impl salsa::Database for MockDatabase { } fn salsa_event(&self, event: impl Fn() -> salsa::Event) { - let mut events = self.events.lock().unwrap(); + let mut events = self.events.lock(); if let Some(events) = &mut *events { events.push(event()); } @@ -51,9 +52,9 @@ impl MockDatabase { impl MockDatabase { pub fn log(&self, f: impl FnOnce()) -> Vec> { - *self.events.lock().unwrap() = Some(Vec::new()); + *self.events.lock() = Some(Vec::new()); f(); - self.events.lock().unwrap().take().unwrap() + self.events.lock().take().unwrap() } pub fn log_executed(&self, f: impl FnOnce()) -> Vec { diff --git a/crates/mun_runtime/Cargo.toml b/crates/mun_runtime/Cargo.toml index 1fadb6300..9ac45ce87 100644 --- a/crates/mun_runtime/Cargo.toml +++ b/crates/mun_runtime/Cargo.toml @@ -14,7 +14,7 @@ failure = "0.1.5" libloading = "0.5" md5= "0.7.0" notify = "4.0.12" -parking_lot = "0.9" +parking_lot = "0.10" tempfile = "3" once_cell = "1.3.1" diff --git a/crates/mun_runtime_capi/Cargo.toml b/crates/mun_runtime_capi/Cargo.toml index 24330d7c8..d3d086099 100644 --- a/crates/mun_runtime_capi/Cargo.toml +++ b/crates/mun_runtime_capi/Cargo.toml @@ -17,7 +17,7 @@ failure = "0.1.5" lazy_static = "1.4.0" mun_abi = { path = "../mun_abi" } mun_runtime = { path = "../mun_runtime" } -parking_lot = "0.9.0" +parking_lot = "0.10" rand = "0.7.2" [dev-dependencies]