mirror of
https://github.com/denoland/deno.git
synced 2025-08-03 18:38:33 +00:00
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:
parent
667acb075c
commit
5b4a9b48ae
13 changed files with 59 additions and 65 deletions
|
@ -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(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue