From fd85f840cd707c31d08fa836562127e249c9ff62 Mon Sep 17 00:00:00 2001 From: Yiyu Lin Date: Sun, 15 Jan 2023 12:06:46 +0800 Subject: refactor: clean up `unwrap` and `clone` (#17282) Co-authored-by: Divy Srivastava --- cli/npm/resolution/mod.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'cli/npm/resolution/mod.rs') diff --git a/cli/npm/resolution/mod.rs b/cli/npm/resolution/mod.rs index bd408e3ec..18158bd17 100644 --- a/cli/npm/resolution/mod.rs +++ b/cli/npm/resolution/mod.rs @@ -239,7 +239,7 @@ impl NpmResolution { package_reqs: Vec, ) -> Result<(), AnyError> { // only allow one thread in here at a time - let _permit = self.update_semaphore.acquire().await.unwrap(); + let _permit = self.update_semaphore.acquire().await?; let snapshot = self.snapshot.read().clone(); let snapshot = self @@ -255,7 +255,7 @@ impl NpmResolution { package_reqs: HashSet, ) -> Result<(), AnyError> { // only allow one thread in here at a time - let _permit = self.update_semaphore.acquire().await.unwrap(); + let _permit = self.update_semaphore.acquire().await?; let snapshot = self.snapshot.read().clone(); let has_removed_package = !snapshot -- cgit v1.2.3