mirror of
https://github.com/denoland/deno.git
synced 2025-08-04 02:48:24 +00:00
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.
This commit is contained in:
parent
c6ae41fd87
commit
64a7187238
7 changed files with 91 additions and 70 deletions
|
@ -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")
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue