From 7fc0e8ec8cd4b18ba10a04cf0ac2bee48826de3d Mon Sep 17 00:00:00 2001 From: David Sherret Date: Tue, 6 Jul 2021 23:48:01 -0400 Subject: 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 --- cli/file_watcher.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cli/file_watcher.rs') 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> { - 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); } } -- cgit v1.2.3