diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-05 18:40:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 18:40:24 +0200 |
commit | 2aed322dd507a8568b6ee6f4897e9a8e3220f763 (patch) | |
tree | e9a45c0b7688a9881ea9ce132b92554ef2955ad6 /runtime/ops/web_worker.rs | |
parent | 284e6c303956e8ca20af63b4ecc045438a260fe6 (diff) |
refactor: convert ops to use serde_v8 (#10009)
This commit rewrites most of the ops to use "serde_v8" instead
of "json" serialization.
Diffstat (limited to 'runtime/ops/web_worker.rs')
-rw-r--r-- | runtime/ops/web_worker.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/runtime/ops/web_worker.rs b/runtime/ops/web_worker.rs index 7918b97ea..5f63a03b7 100644 --- a/runtime/ops/web_worker.rs +++ b/runtime/ops/web_worker.rs @@ -4,7 +4,6 @@ use crate::web_worker::WebWorkerHandle; use crate::web_worker::WorkerEvent; use deno_core::error::null_opbuf; use deno_core::futures::channel::mpsc; -use deno_core::serde_json::{json, Value}; pub fn init( rt: &mut deno_core::JsRuntime, @@ -16,14 +15,14 @@ pub fn init( super::reg_json_sync( rt, "op_worker_post_message", - move |_state, _args: Value, buf| { + move |_state, _args: (), buf| { let buf = buf.ok_or_else(null_opbuf)?; let msg_buf: Box<[u8]> = (*buf).into(); sender_ .clone() .try_send(WorkerEvent::Message(msg_buf)) .expect("Failed to post message to host"); - Ok(json!({})) + Ok(()) }, ); @@ -31,12 +30,12 @@ pub fn init( super::reg_json_sync( rt, "op_worker_close", - move |_state, _args: Value, _bufs| { + move |_state, _args: (), _bufs| { // Notify parent that we're finished sender.clone().close_channel(); // Terminate execution of current worker handle.terminate(); - Ok(json!({})) + Ok(()) }, ); } |