1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-12-24 08:09:08 -05:00

refactor: Remove unused code (#12210)

This commit is contained in:
Ryan Dahl 2021-09-24 18:35:35 -04:00 committed by GitHub
parent d0e14ae82c
commit 683a38e47c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 2 additions and 33 deletions

View file

@ -213,7 +213,7 @@ pub fn map_content_type(
}
/// Remove shebangs from the start of source code strings
pub fn strip_shebang(mut value: String) -> String {
fn strip_shebang(mut value: String) -> String {
if value.starts_with("#!") {
if let Some(mid) = value.find('\n') {
let (_, rest) = value.split_at(mid);

View file

@ -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,

View file

@ -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,

View file

@ -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)
}

View file

@ -505,7 +505,7 @@ impl WebWorker {
}
}
pub fn poll_event_loop(
fn poll_event_loop(
&mut self,
cx: &mut Context,
wait_for_inspector: bool,