mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +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
|
@ -126,7 +126,7 @@ impl NpmPackageFsResolver for GlobalNpmPackageResolver {
|
|||
|
||||
fn ensure_read_permission(
|
||||
&self,
|
||||
permissions: &mut dyn NodePermissions,
|
||||
permissions: &dyn NodePermissions,
|
||||
path: &Path,
|
||||
) -> Result<(), AnyError> {
|
||||
let registry_path = self.cache.registry_folder(&self.registry_url);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue