From 2167a52d693e79c661f91d29164f59111f3bc3c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Mon, 9 Oct 2023 02:08:10 +0200 Subject: refactor: remove TimersPermissions::check_unstable (#20831) This is dead code that was not used in any way. Ref https://github.com/denoland/deno/pull/20797 --- ext/web/benches/encoding.rs | 4 ---- ext/web/benches/timers_ops.rs | 2 -- ext/web/timers.rs | 1 - runtime/build.rs | 8 -------- runtime/permissions/mod.rs | 6 ------ 5 files changed, 21 deletions(-) diff --git a/ext/web/benches/encoding.rs b/ext/web/benches/encoding.rs index fc4ab37fc..94c52bb59 100644 --- a/ext/web/benches/encoding.rs +++ b/ext/web/benches/encoding.rs @@ -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; @@ -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 { diff --git a/ext/web/benches/timers_ops.rs b/ext/web/benches/timers_ops.rs index 589fc8534..80d144f52 100644 --- a/ext/web/benches/timers_ops.rs +++ b/ext/web/benches/timers_ops.rs @@ -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; @@ -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 { diff --git a/ext/web/timers.rs b/ext/web/timers.rs index 17b46c2be..67beee599 100644 --- a/ext/web/timers.rs +++ b/ext/web/timers.rs @@ -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; diff --git a/runtime/build.rs b/runtime/build.rs index 6684afe09..dec687b6e 100644 --- a/runtime/build.rs +++ b/runtime/build.rs @@ -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 { diff --git a/runtime/permissions/mod.rs b/runtime/permissions/mod.rs index 77f44b813..34d7f0a1b 100644 --- a/runtime/permissions/mod.rs +++ b/runtime/permissions/mod.rs @@ -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; @@ -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 { -- cgit v1.2.3