Skip to content

Commit

Permalink
refactor: remove TimersPermissions::check_unstable (denoland#20831)
Browse files Browse the repository at this point in the history
This is dead code that was not used in any way.

Ref denoland#20797
  • Loading branch information
bartlomieju authored Oct 9, 2023
1 parent dfc254c commit 2167a52
Show file tree
Hide file tree
Showing 5 changed files with 0 additions and 21 deletions.
4 changes: 0 additions & 4 deletions ext/web/benches/encoding.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
use deno_core::OpState;

#[derive(Clone)]
struct Permissions;
Expand All @@ -16,9 +15,6 @@ impl deno_web::TimersPermission for Permissions {
fn allow_hrtime(&mut self) -> bool {
false
}
fn check_unstable(&self, _state: &OpState, _api_name: &'static str) {
unreachable!()
}
}

fn setup() -> Vec<Extension> {
Expand Down
2 changes: 0 additions & 2 deletions ext/web/benches/timers_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ use deno_bench_util::bencher::Bencher;
use deno_core::Extension;
use deno_core::ExtensionFileSource;
use deno_core::ExtensionFileSourceCode;
use deno_core::OpState;

#[derive(Clone)]
struct Permissions;
Expand All @@ -16,7 +15,6 @@ impl deno_web::TimersPermission for Permissions {
fn allow_hrtime(&mut self) -> bool {
true
}
fn check_unstable(&self, _state: &OpState, _api_name: &'static str) {}
}

fn setup() -> Vec<Extension> {
Expand Down
1 change: 0 additions & 1 deletion ext/web/timers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ use std::time::Instant;

pub trait TimersPermission {
fn allow_hrtime(&mut self) -> bool;
fn check_unstable(&self, state: &OpState, api_name: &'static str);
}

pub type StartTime = Instant;
Expand Down
8 changes: 0 additions & 8 deletions runtime/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,14 +55,6 @@ mod startup_snapshot {
fn allow_hrtime(&mut self) -> bool {
unreachable!("snapshotting!")
}

fn check_unstable(
&self,
_state: &deno_core::OpState,
_api_name: &'static str,
) {
unreachable!("snapshotting!")
}
}

impl deno_ffi::FfiPermissions for Permissions {
Expand Down
6 changes: 0 additions & 6 deletions runtime/permissions/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ use deno_core::serde_json;
use deno_core::url;
use deno_core::url::Url;
use deno_core::ModuleSpecifier;
use deno_core::OpState;
use log;
use once_cell::sync::Lazy;
use std::borrow::Cow;
Expand Down Expand Up @@ -1434,11 +1433,6 @@ impl deno_web::TimersPermission for PermissionsContainer {
fn allow_hrtime(&mut self) -> bool {
self.0.lock().hrtime.check().is_ok()
}

#[inline(always)]
fn check_unstable(&self, state: &OpState, api_name: &'static str) {
crate::ops::check_unstable(state, api_name);
}
}

impl deno_websocket::WebSocketPermissions for PermissionsContainer {
Expand Down

0 comments on commit 2167a52

Please sign in to comment.