mirror of
https://github.com/denoland/deno.git
synced 2025-02-08 07:16:56 -05:00
Remove unused code
This commit is contained in:
parent
9705efd419
commit
b2525c6f17
6 changed files with 3 additions and 48 deletions
|
@ -50,12 +50,6 @@ pub struct InspectorSessionProxy {
|
|||
pub rx: SessionProxyReceiver,
|
||||
}
|
||||
|
||||
impl InspectorSessionProxy {
|
||||
pub fn split(self) -> (SessionProxySender, SessionProxyReceiver) {
|
||||
(self.tx, self.rx)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Copy)]
|
||||
enum PollState {
|
||||
Idle,
|
||||
|
|
|
@ -603,7 +603,7 @@ impl JsRuntime {
|
|||
///
|
||||
/// Calls the closure with the current heap limit and the initial heap limit.
|
||||
/// The return value of the closure is set as the new limit.
|
||||
pub fn add_near_heap_limit_callback<C>(&mut self, cb: C)
|
||||
fn add_near_heap_limit_callback<C>(&mut self, cb: C)
|
||||
where
|
||||
C: FnMut(usize, usize) -> usize + 'static,
|
||||
{
|
||||
|
@ -625,7 +625,7 @@ impl JsRuntime {
|
|||
.add_near_heap_limit_callback(near_heap_limit_callback::<C>, data);
|
||||
}
|
||||
|
||||
pub fn remove_near_heap_limit_callback(&mut self, heap_limit: usize) {
|
||||
fn remove_near_heap_limit_callback(&mut self, heap_limit: usize) {
|
||||
if let Some((_, cb)) = self.allocations.near_heap_limit_callback_data.take()
|
||||
{
|
||||
self
|
||||
|
@ -1424,22 +1424,6 @@ impl JsRuntime {
|
|||
Ok(root_id)
|
||||
}
|
||||
|
||||
/// Asynchronously load specified module and all of its dependencies
|
||||
///
|
||||
/// User must call `JsRuntime::mod_evaluate` with returned `ModuleId`
|
||||
/// manually after load is finished.
|
||||
#[deprecated(
|
||||
since = "0.100.0",
|
||||
note = "This method had a bug, marking multiple modules loaded as \"main\". Use `load_main_module` or `load_side_module` instead."
|
||||
)]
|
||||
pub async fn load_module(
|
||||
&mut self,
|
||||
specifier: &ModuleSpecifier,
|
||||
code: Option<String>,
|
||||
) -> Result<ModuleId, AnyError> {
|
||||
self.load_main_module(specifier, code).await
|
||||
}
|
||||
|
||||
fn poll_pending_ops(
|
||||
&mut self,
|
||||
cx: &mut Context,
|
||||
|
|
|
@ -157,10 +157,6 @@ impl TlsStream {
|
|||
Self::new(tcp, tls)
|
||||
}
|
||||
|
||||
pub async fn handshake(&mut self) -> io::Result<()> {
|
||||
poll_fn(|cx| self.inner_mut().poll_io(cx, Flow::Write)).await
|
||||
}
|
||||
|
||||
fn into_split(self) -> (ReadHalf, WriteHalf) {
|
||||
let shared = Shared::new(self);
|
||||
let rd = ReadHalf {
|
||||
|
|
|
@ -13,12 +13,3 @@ pub fn create_basic_runtime() -> tokio::runtime::Runtime {
|
|||
.build()
|
||||
.unwrap()
|
||||
}
|
||||
|
||||
// TODO(ry) rename to run_local ?
|
||||
pub fn run_basic<F, R>(future: F) -> R
|
||||
where
|
||||
F: std::future::Future<Output = R>,
|
||||
{
|
||||
let rt = create_basic_runtime();
|
||||
rt.block_on(future)
|
||||
}
|
||||
|
|
|
@ -505,7 +505,7 @@ impl WebWorker {
|
|||
}
|
||||
}
|
||||
|
||||
pub fn poll_event_loop(
|
||||
fn poll_event_loop(
|
||||
&mut self,
|
||||
cx: &mut Context,
|
||||
wait_for_inspector: bool,
|
||||
|
|
|
@ -29,8 +29,6 @@ use std::env;
|
|||
use std::pin::Pin;
|
||||
use std::rc::Rc;
|
||||
use std::sync::Arc;
|
||||
use std::task::Context;
|
||||
use std::task::Poll;
|
||||
|
||||
/// This worker is created and used by almost all
|
||||
/// subcommands in Deno executable.
|
||||
|
@ -280,14 +278,6 @@ impl MainWorker {
|
|||
inspector.create_local_session()
|
||||
}
|
||||
|
||||
pub fn poll_event_loop(
|
||||
&mut self,
|
||||
cx: &mut Context,
|
||||
wait_for_inspector: bool,
|
||||
) -> Poll<Result<(), AnyError>> {
|
||||
self.js_runtime.poll_event_loop(cx, wait_for_inspector)
|
||||
}
|
||||
|
||||
pub async fn run_event_loop(
|
||||
&mut self,
|
||||
wait_for_inspector: bool,
|
||||
|
|
Loading…
Add table
Reference in a new issue