From 64a7187238c4f291f254bd6eb58138a3a6534898 Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 4 Oct 2021 22:56:24 +0200 Subject: chore: remove No*Permissions structs (#12316) These are confusing. They say they are "for users that don't care about permissions", but that isn't correct. `NoTimersPermissions` disables permissions instead of enabling them. I would argue that implementors should decide what permissions they want themselves, and not take our opinionated permissions struct. --- ext/fetch/lib.rs | 13 ------------- 1 file changed, 13 deletions(-) (limited to 'ext/fetch') diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index b422c2741..dfb1ce059 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -120,19 +120,6 @@ pub trait FetchPermissions { fn check_read(&mut self, _p: &Path) -> Result<(), AnyError>; } -/// For use with `op_fetch` when the user does not want permissions. -pub struct NoFetchPermissions; - -impl FetchPermissions for NoFetchPermissions { - fn check_net_url(&mut self, _url: &Url) -> Result<(), AnyError> { - Ok(()) - } - - fn check_read(&mut self, _p: &Path) -> Result<(), AnyError> { - Ok(()) - } -} - pub fn get_declaration() -> PathBuf { PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("lib.deno_fetch.d.ts") } -- cgit v1.2.3