diff options
author | Gurwinder Singh <vargwin@gmail.com> | 2020-07-14 23:52:02 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-07-14 14:22:02 -0400 |
commit | f83d672ffad7afb1473bd4f9b9c645539064c620 (patch) | |
tree | f8a0b30ffd79965b7672c1c130af08dd798b750e /cli/ops/web_worker.rs | |
parent | 7be29fab8d4267bca9c8f0020f634fe5f1bd3caa (diff) |
refactor: new trait JsonOpDispatcher (#6742)
Diffstat (limited to 'cli/ops/web_worker.rs')
-rw-r--r-- | cli/ops/web_worker.rs | 13 |
1 files changed, 3 insertions, 10 deletions
diff --git a/cli/ops/web_worker.rs b/cli/ops/web_worker.rs index 553278b07..4a661d2be 100644 --- a/cli/ops/web_worker.rs +++ b/cli/ops/web_worker.rs @@ -2,6 +2,7 @@ use super::dispatch_json::{JsonOp, Value}; use crate::op_error::OpError; use crate::ops::json_op; +use crate::ops::JsonOpDispatcher; use crate::state::State; use crate::web_worker::WebWorkerHandle; use crate::worker::WorkerEvent; @@ -14,11 +15,7 @@ use std::convert::From; pub fn web_worker_op<D>( sender: mpsc::Sender<WorkerEvent>, dispatcher: D, -) -> impl Fn( - &mut CoreIsolateState, - Value, - &mut [ZeroCopyBuf], -) -> Result<JsonOp, OpError> +) -> impl JsonOpDispatcher where D: Fn( &mpsc::Sender<WorkerEvent>, @@ -36,11 +33,7 @@ pub fn web_worker_op2<D>( handle: WebWorkerHandle, sender: mpsc::Sender<WorkerEvent>, dispatcher: D, -) -> impl Fn( - &mut CoreIsolateState, - Value, - &mut [ZeroCopyBuf], -) -> Result<JsonOp, OpError> +) -> impl JsonOpDispatcher where D: Fn( WebWorkerHandle, |