summaryrefslogtreecommitdiff
path: root/runtime/ops/plugin.rs
diff options
context:
space:
mode:
authorcrowlKats <13135287+crowlKats@users.noreply.github.com>2021-03-18 19:42:01 +0100
committerGitHub <noreply@github.com>2021-03-18 14:42:01 -0400
commitb59151f39eba2ddcfe9448dfecd043046d7a0852 (patch)
tree06591bbf8e26910f808f20c4bbeaf9eaf764339c /runtime/ops/plugin.rs
parent62716422b9f57b11f3a0afb01f5011b63702226d (diff)
move runtime ops to serde ops (#9828)
Diffstat (limited to 'runtime/ops/plugin.rs')
-rw-r--r--runtime/ops/plugin.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/runtime/ops/plugin.rs b/runtime/ops/plugin.rs
index e02276756..bfad7c673 100644
--- a/runtime/ops/plugin.rs
+++ b/runtime/ops/plugin.rs
@@ -5,7 +5,6 @@ use crate::permissions::Permissions;
use deno_core::error::AnyError;
use deno_core::futures::prelude::*;
use deno_core::plugin_api;
-use deno_core::serde_json;
use deno_core::serde_json::json;
use deno_core::serde_json::Value;
use deno_core::BufVec;
@@ -32,16 +31,15 @@ pub fn init(rt: &mut JsRuntime) {
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
-struct OpenPluginArgs {
+pub struct OpenPluginArgs {
filename: String,
}
pub fn op_open_plugin(
state: &mut OpState,
- args: Value,
+ args: OpenPluginArgs,
_zero_copy: &mut [ZeroCopyBuf],
) -> Result<Value, AnyError> {
- let args: OpenPluginArgs = serde_json::from_value(args)?;
let filename = PathBuf::from(&args.filename);
super::check_unstable(state, "Deno.openPlugin");