summaryrefslogtreecommitdiff
path: root/cli/npm/resolution/mod.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-06 03:29:50 +0800
committerGitHub <noreply@github.com>2023-01-05 14:29:50 -0500
commit896dd56b7af06fea6604a5596a6ffd17e7e52e6e (patch)
tree92d3c94afe4923f1d1faccc8034a03f78b807ade /cli/npm/resolution/mod.rs
parent4e6b78cb43ece70df28281c8033b51366b110acf (diff)
refactor(cli,core,ext,rt): remove some unnecessary `clone` or `malloc` (#17274)
Diffstat (limited to 'cli/npm/resolution/mod.rs')
-rw-r--r--cli/npm/resolution/mod.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/cli/npm/resolution/mod.rs b/cli/npm/resolution/mod.rs
index c6e1c5d25..bd408e3ec 100644
--- a/cli/npm/resolution/mod.rs
+++ b/cli/npm/resolution/mod.rs
@@ -210,7 +210,7 @@ impl NpmResolutionPackage {
pub struct NpmResolution {
api: RealNpmRegistryApi,
snapshot: RwLock<NpmResolutionSnapshot>,
- update_sempahore: tokio::sync::Semaphore,
+ update_semaphore: tokio::sync::Semaphore,
}
impl std::fmt::Debug for NpmResolution {
@@ -230,7 +230,7 @@ impl NpmResolution {
Self {
api,
snapshot: RwLock::new(initial_snapshot.unwrap_or_default()),
- update_sempahore: tokio::sync::Semaphore::new(1),
+ update_semaphore: tokio::sync::Semaphore::new(1),
}
}
@@ -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_sempahore.acquire().await.unwrap();
+ let _permit = self.update_semaphore.acquire().await.unwrap();
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_sempahore.acquire().await.unwrap();
+ let _permit = self.update_semaphore.acquire().await.unwrap();
let snapshot = self.snapshot.read().clone();
let has_removed_package = !snapshot