diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-02 15:47:57 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-02 09:47:57 -0400 |
commit | 058579da562989ed15c86598053644bbc86c6747 (patch) | |
tree | 7f0f2bf30684dcbb350b93d987771f17a4abd250 /runtime/ops/plugin.rs | |
parent | adf57610904cb4f4ef25fb077f6e39c9017a4ea9 (diff) |
refactor(ops): remove variadic buffers (#9944)
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)), |