diff options
Diffstat (limited to 'cli/npm')
-rw-r--r-- | cli/npm/cache.rs | 4 | ||||
-rw-r--r-- | cli/npm/registry.rs | 2 | ||||
-rw-r--r-- | cli/npm/resolution/specifier.rs | 2 | ||||
-rw-r--r-- | cli/npm/resolvers/common.rs | 2 | ||||
-rw-r--r-- | cli/npm/tarball.rs | 4 |
5 files changed, 7 insertions, 7 deletions
diff --git a/cli/npm/cache.rs b/cli/npm/cache.rs index b052f89cd..2ca597bd7 100644 --- a/cli/npm/cache.rs +++ b/cli/npm/cache.rs @@ -78,7 +78,7 @@ pub fn with_folder_sync_lock( match inner(output_folder, action) { Ok(()) => Ok(()), Err(err) => { - if let Err(remove_err) = fs::remove_dir_all(&output_folder) { + if let Err(remove_err) = fs::remove_dir_all(output_folder) { if remove_err.kind() != std::io::ErrorKind::NotFound { bail!( concat!( @@ -156,7 +156,7 @@ impl ReadonlyNpmCache { root_dir: &Path, ) -> Result<PathBuf, AnyError> { if !root_dir.exists() { - std::fs::create_dir_all(&root_dir) + std::fs::create_dir_all(root_dir) .with_context(|| format!("Error creating {}", root_dir.display()))?; } Ok(crate::fs_util::canonicalize_path(root_dir)?) diff --git a/cli/npm/registry.rs b/cli/npm/registry.rs index e6af92fe8..066c136ee 100644 --- a/cli/npm/registry.rs +++ b/cli/npm/registry.rs @@ -397,7 +397,7 @@ impl RealNpmRegistryApiInner { ) -> Result<(), AnyError> { let file_cache_path = self.get_package_file_cache_path(name); let file_text = serde_json::to_string(&package_info)?; - std::fs::create_dir_all(&file_cache_path.parent().unwrap())?; + std::fs::create_dir_all(file_cache_path.parent().unwrap())?; fs_util::atomic_write_file(&file_cache_path, file_text, CACHE_PERM)?; Ok(()) } diff --git a/cli/npm/resolution/specifier.rs b/cli/npm/resolution/specifier.rs index efcea9d99..1a1590a2f 100644 --- a/cli/npm/resolution/specifier.rs +++ b/cli/npm/resolution/specifier.rs @@ -245,7 +245,7 @@ pub fn resolve_npm_package_reqs(graph: &ModuleGraph) -> Vec<NpmPackageReq> { for specifier in &specifiers { if let Ok(npm_ref) = NpmPackageReference::from_specifier(specifier) { leaf.reqs.insert(npm_ref.req); - } else if !specifier.as_str().starts_with(&parent_specifier.as_str()) { + } else if !specifier.as_str().starts_with(parent_specifier.as_str()) { leaf .dependencies .insert(get_folder_path_specifier(specifier)); diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs index 11fa6512c..b160697d1 100644 --- a/cli/npm/resolvers/common.rs +++ b/cli/npm/resolvers/common.rs @@ -104,7 +104,7 @@ pub fn ensure_registry_read_permission( path: &Path, ) -> Result<(), AnyError> { // allow reading if it's in the node_modules - if path.starts_with(®istry_path) + if path.starts_with(registry_path) && path .components() .all(|c| !matches!(c, std::path::Component::ParentDir)) diff --git a/cli/npm/tarball.rs b/cli/npm/tarball.rs index 751e093f5..487a8a6aa 100644 --- a/cli/npm/tarball.rs +++ b/cli/npm/tarball.rs @@ -110,8 +110,8 @@ fn extract_tarball(data: &[u8], output_folder: &Path) -> Result<(), AnyError> { absolute_path.parent().unwrap() }; if created_dirs.insert(dir_path.to_path_buf()) { - fs::create_dir_all(&dir_path)?; - let canonicalized_dir = fs::canonicalize(&dir_path)?; + fs::create_dir_all(dir_path)?; + let canonicalized_dir = fs::canonicalize(dir_path)?; if !canonicalized_dir.starts_with(&output_folder) { bail!( "Extracted directory '{}' of npm tarball was not in output directory.", |