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 /runtime/permissions | |
| 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 'runtime/permissions')
| -rw-r--r-- | runtime/permissions/mod.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index b15750313..6cce7d1e9 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -1872,7 +1872,7 @@ impl PermissionsContainer { impl deno_node::NodePermissions for PermissionsContainer { #[inline(always)] - fn check_read(&mut self, path: &Path) -> Result<(), AnyError> { + fn check_read(&self, path: &Path) -> Result<(), AnyError> { self.0.lock().read.check(path, None) } } |
