mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 10:33:54 +00:00
refactor: clean up unwrap
and clone
(#17282)
Co-authored-by: Divy Srivastava <dj.srivastava23@gmail.com>
This commit is contained in:
parent
05ef925eb0
commit
fd85f840cd
15 changed files with 75 additions and 94 deletions
|
@ -239,7 +239,7 @@ impl NpmResolution {
|
|||
package_reqs: Vec<NpmPackageReq>,
|
||||
) -> 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<NpmPackageReq>,
|
||||
) -> 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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue