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`.
This commit is contained in:
David Sherret 2023-04-24 21:07:48 -04:00 committed by GitHub
parent 667acb075c
commit 5b4a9b48ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 59 additions and 65 deletions

View file

@ -206,7 +206,7 @@ impl NpmPackageFsResolver for LocalNpmPackageResolver {
fn ensure_read_permission(
&self,
permissions: &mut dyn NodePermissions,
permissions: &dyn NodePermissions,
path: &Path,
) -> Result<(), AnyError> {
ensure_registry_read_permission(