Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improvement: bump parking_lot dependency to 0.10 #103

Merged
merged 1 commit into from
Mar 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions crates/mun_hir/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,3 +21,4 @@ either = "1.5.3"

[dev-dependencies]
insta = "0.12.0"
parking_lot = "0.10"
9 changes: 5 additions & 4 deletions crates/mun_hir/src/mock.rs
Original file line number Diff line number Diff line change
@@ -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(
Expand All @@ -21,7 +22,7 @@ impl salsa::Database for MockDatabase {
}

fn salsa_event(&self, event: impl Fn() -> salsa::Event<MockDatabase>) {
let mut events = self.events.lock().unwrap();
let mut events = self.events.lock();
if let Some(events) = &mut *events {
events.push(event());
}
Expand Down Expand Up @@ -51,9 +52,9 @@ impl MockDatabase {

impl MockDatabase {
pub fn log(&self, f: impl FnOnce()) -> Vec<salsa::Event<MockDatabase>> {
*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<String> {
Expand Down
2 changes: 1 addition & 1 deletion crates/mun_runtime/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion crates/mun_runtime_capi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down