From 2aed322dd507a8568b6ee6f4897e9a8e3220f763 Mon Sep 17 00:00:00 2001 From: Aaron O'Mullan Date: Mon, 5 Apr 2021 18:40:24 +0200 Subject: refactor: convert ops to use serde_v8 (#10009) This commit rewrites most of the ops to use "serde_v8" instead of "json" serialization. --- op_crates/crypto/lib.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'op_crates/crypto/lib.rs') diff --git a/op_crates/crypto/lib.rs b/op_crates/crypto/lib.rs index 9fc61d871..c74b1b2c2 100644 --- a/op_crates/crypto/lib.rs +++ b/op_crates/crypto/lib.rs @@ -4,8 +4,6 @@ use deno_core::error::null_opbuf; use deno_core::error::AnyError; -use deno_core::serde_json::json; -use deno_core::serde_json::Value; use deno_core::JsRuntime; use deno_core::OpState; use deno_core::ZeroCopyBuf; @@ -29,9 +27,9 @@ pub fn init(isolate: &mut JsRuntime) { pub fn op_crypto_get_random_values( state: &mut OpState, - _args: Value, + _args: (), zero_copy: Option, -) -> Result { +) -> Result<(), AnyError> { let mut zero_copy = zero_copy.ok_or_else(null_opbuf)?; let maybe_seeded_rng = state.try_borrow_mut::(); if let Some(seeded_rng) = maybe_seeded_rng { @@ -41,7 +39,7 @@ pub fn op_crypto_get_random_values( rng.fill(&mut *zero_copy); } - Ok(json!({})) + Ok(()) } pub fn get_declaration() -> PathBuf { -- cgit v1.2.3