diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-10-04 20:55:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-10-04 20:55:41 +0100 |
commit | 2de4faa483982478e9a36ad4ab891a887b4779f1 (patch) | |
tree | 5ee8512e5dc380759054900943074d5b6ee8c65c /cli/npm/managed/mod.rs | |
parent | f288730c38bd4f13b464a9bd67eb901a8c790bc4 (diff) |
refactor: improve node permission checks (#26028)
Does less work when requesting permissions with `-A`
Diffstat (limited to 'cli/npm/managed/mod.rs')
-rw-r--r-- | cli/npm/managed/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cli/npm/managed/mod.rs b/cli/npm/managed/mod.rs index 225cd6c29..ec50a9c65 100644 --- a/cli/npm/managed/mod.rs +++ b/cli/npm/managed/mod.rs @@ -1,5 +1,6 @@ // Copyright 2018-2024 the Deno authors. All rights reserved. MIT license. +use std::borrow::Cow; use std::path::Path; use std::path::PathBuf; use std::sync::Arc; @@ -593,11 +594,11 @@ impl NpmResolver for ManagedCliNpmResolver { } impl NodeRequireResolver for ManagedCliNpmResolver { - fn ensure_read_permission( + fn ensure_read_permission<'a>( &self, permissions: &mut dyn NodePermissions, - path: &Path, - ) -> Result<(), AnyError> { + path: &'a Path, + ) -> Result<Cow<'a, Path>, AnyError> { self.fs_resolver.ensure_read_permission(permissions, path) } } |