diff options
author | David Sherret <dsherret@users.noreply.github.com> | 2024-06-06 23:37:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-06 23:37:53 -0400 |
commit | 386d5c8310891c5dc9627abbf2374e60bb4e50d2 (patch) | |
tree | 920367bb6e14a5d259a01765962e93ff991c1fa0 /ext/kv/remote.rs | |
parent | a17794d5cf0c8d1ecc624c490071e5b3a5856bc7 (diff) |
refactor: remove `PermissionsContainer` in deno_runtime (#24119)
Also removes permissions being passed in for node resolution. It was
completely useless because we only checked it for reading package.json
files, but Deno reading package.json files for resolution is perfectly
fine.
My guess is this is also a perf improvement because Deno is doing less
work.
Diffstat (limited to 'ext/kv/remote.rs')
-rw-r--r-- | ext/kv/remote.rs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/kv/remote.rs b/ext/kv/remote.rs index 9d5e099c7..a1273e78b 100644 --- a/ext/kv/remote.rs +++ b/ext/kv/remote.rs @@ -48,6 +48,22 @@ pub trait RemoteDbHandlerPermissions { ) -> Result<(), AnyError>; } +impl RemoteDbHandlerPermissions for deno_permissions::PermissionsContainer { + #[inline(always)] + fn check_env(&mut self, var: &str) -> Result<(), AnyError> { + deno_permissions::PermissionsContainer::check_env(self, var) + } + + #[inline(always)] + fn check_net_url( + &mut self, + url: &Url, + api_name: &str, + ) -> Result<(), AnyError> { + deno_permissions::PermissionsContainer::check_net_url(self, url, api_name) + } +} + pub struct RemoteDbHandler<P: RemoteDbHandlerPermissions + 'static> { http_options: HttpOptions, _p: std::marker::PhantomData<P>, |