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_watcher.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_watcher.rs')
-rw-r--r-- | cli/file_watcher.rs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/cli/file_watcher.rs b/cli/file_watcher.rs index 7251dbe8c..aee3fe787 100644 --- a/cli/file_watcher.rs +++ b/cli/file_watcher.rs @@ -4,6 +4,7 @@ use crate::colors; use deno_core::error::AnyError; use deno_core::futures::stream::{Stream, StreamExt}; use deno_core::futures::Future; +use deno_core::parking_lot::Mutex; use log::info; use notify::event::Event as NotifyEvent; use notify::event::EventKind; @@ -17,7 +18,6 @@ use std::collections::HashSet; use std::path::PathBuf; use std::pin::Pin; use std::sync::Arc; -use std::sync::Mutex; use std::task::Context; use std::task::Poll; use std::time::Duration; @@ -54,7 +54,7 @@ impl Stream for Debounce { self: Pin<&mut Self>, cx: &mut Context, ) -> Poll<Option<Self::Item>> { - let mut changed_paths = self.changed_paths.lock().unwrap(); + let mut changed_paths = self.changed_paths.lock(); if changed_paths.len() > 0 { Poll::Ready(Some(changed_paths.drain().collect())) } else { @@ -232,7 +232,7 @@ fn new_watcher( .paths .iter() .filter_map(|path| path.canonicalize().ok()); - let mut changed_paths = changed_paths.lock().unwrap(); + let mut changed_paths = changed_paths.lock(); changed_paths.extend(paths); } } |