summaryrefslogtreecommitdiff
path: root/runtime/worker.rs
diff options
context:
space:
mode:
authorYiyu Lin <linyiyu1992@gmail.com>2023-01-06 03:29:50 +0800
committerGitHub <noreply@github.com>2023-01-05 14:29:50 -0500
commit896dd56b7af06fea6604a5596a6ffd17e7e52e6e (patch)
tree92d3c94afe4923f1d1faccc8034a03f78b807ade /runtime/worker.rs
parent4e6b78cb43ece70df28281c8033b51366b110acf (diff)
refactor(cli,core,ext,rt): remove some unnecessary `clone` or `malloc` (#17274)
Diffstat (limited to 'runtime/worker.rs')
-rw-r--r--runtime/worker.rs30
1 files changed, 16 insertions, 14 deletions
diff --git a/runtime/worker.rs b/runtime/worker.rs
index 360a6b3d7..ea9f4f3e7 100644
--- a/runtime/worker.rs
+++ b/runtime/worker.rs
@@ -1,11 +1,13 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.
-use crate::inspector_server::InspectorServer;
-use crate::js;
-use crate::ops;
-use crate::ops::io::Stdio;
-use crate::permissions::Permissions;
-use crate::BootstrapOptions;
+use std::pin::Pin;
+use std::rc::Rc;
+use std::sync::atomic::AtomicI32;
+use std::sync::atomic::Ordering::Relaxed;
+use std::sync::Arc;
+use std::task::Context;
+use std::task::Poll;
+
use deno_broadcast_channel::InMemoryBroadcastChannel;
use deno_cache::CreateCache;
use deno_cache::SqliteBackedCache;
@@ -31,13 +33,13 @@ use deno_node::RequireNpmResolver;
use deno_tls::rustls::RootCertStore;
use deno_web::BlobStore;
use log::debug;
-use std::pin::Pin;
-use std::rc::Rc;
-use std::sync::atomic::AtomicI32;
-use std::sync::atomic::Ordering::Relaxed;
-use std::sync::Arc;
-use std::task::Context;
-use std::task::Poll;
+
+use crate::inspector_server::InspectorServer;
+use crate::js;
+use crate::ops;
+use crate::ops::io::Stdio;
+use crate::permissions::Permissions;
+use crate::BootstrapOptions;
pub type FormatJsErrorFn = dyn Fn(&JsError) -> String + Sync + Send;
@@ -458,7 +460,7 @@ impl MainWorker {
/// Return exit code set by the executed code (either in main worker
/// or one of child web workers).
- pub fn get_exit_code(&self) -> i32 {
+ pub fn exit_code(&self) -> i32 {
self.exit_code.get()
}