diff options
Diffstat (limited to 'runtime/ops/plugin.rs')
-rw-r--r-- | runtime/ops/plugin.rs | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/runtime/ops/plugin.rs b/runtime/ops/plugin.rs index 7fc59d082..709c5730d 100644 --- a/runtime/ops/plugin.rs +++ b/runtime/ops/plugin.rs @@ -6,7 +6,6 @@ use deno_core::futures::prelude::*; use deno_core::plugin_api; use deno_core::serde_json::json; use deno_core::serde_json::Value; -use deno_core::BufVec; use deno_core::JsRuntime; use deno_core::Op; use deno_core::OpAsyncFuture; @@ -38,7 +37,7 @@ pub struct OpenPluginArgs { pub fn op_open_plugin( state: &mut OpState, args: OpenPluginArgs, - _zero_copy: &mut [ZeroCopyBuf], + _zero_copy: Option<ZeroCopyBuf>, ) -> Result<Value, AnyError> { let filename = PathBuf::from(&args.filename); @@ -111,16 +110,9 @@ impl<'a> plugin_api::Interface for PluginInterface<'a> { ) -> OpId { let plugin_lib = self.plugin_lib.clone(); let plugin_op_fn: Box<OpFn> = Box::new(move |state_rc, _payload, buf| { - // For sig compat map Option<ZeroCopyBuf> to BufVec - let mut bufs: BufVec = match buf { - Some(b) => vec![b], - None => vec![], - } - .into(); - let mut state = state_rc.borrow_mut(); let mut interface = PluginInterface::new(&mut state, &plugin_lib); - let op = dispatch_op_fn(&mut interface, &mut bufs); + let op = dispatch_op_fn(&mut interface, buf); match op { sync_op @ Op::Sync(..) => sync_op, Op::Async(fut) => Op::Async(PluginOpAsyncFuture::new(&plugin_lib, fut)), |