diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2023-04-24 21:07:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-04-24 21:07:48 -0400 |
commit | 5b4a9b48aeabded174cc161bfdafb6529cffbca1 (patch) | |
tree | 77a2e82cfe04e2c1c04200496499a11f6d53b7e9 /cli/npm/resolvers/common.rs | |
parent | 667acb075c0f1fb62bc1177f46b550e9dd506c00 (diff) |
refactor(ext/node): enforce interior mutable for `NodePermissions` to remove clones (#18831)
We can make `NodePermissions` rely on interior mutability (which the
`PermissionsContainer` is already doing) in order to not have to clone
everything all the time. This also reduces the chance of an accidental
`borrow` while `borrrow_mut`.
Diffstat (limited to 'cli/npm/resolvers/common.rs')
-rw-r--r-- | cli/npm/resolvers/common.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/npm/resolvers/common.rs b/cli/npm/resolvers/common.rs index a31459a70..ccba00d43 100644 --- a/cli/npm/resolvers/common.rs +++ b/cli/npm/resolvers/common.rs @@ -47,7 +47,7 @@ pub trait NpmPackageFsResolver: Send + Sync { fn ensure_read_permission( &self, - permissions: &mut dyn NodePermissions, + permissions: &dyn NodePermissions, path: &Path, ) -> Result<(), AnyError>; } @@ -90,7 +90,7 @@ pub async fn cache_packages( } pub fn ensure_registry_read_permission( - permissions: &mut dyn NodePermissions, + permissions: &dyn NodePermissions, registry_path: &Path, path: &Path, ) -> Result<(), AnyError> { |