Skip to content

Commit

Permalink
Merge pull request #103 from Wodann/improvement/bump-parking-lot
Browse files Browse the repository at this point in the history
improvement: bump parking_lot dependency to 0.10
  • Loading branch information
baszalmstra authored Mar 25, 2020
2 parents c72b965 + 1fd8c0f commit 098eede
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
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

0 comments on commit 098eede

Please sign in to comment.