diff options
author | Aaron O'Mullan <aaron.omullan@gmail.com> | 2021-04-05 18:40:24 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-05 18:40:24 +0200 |
commit | 2aed322dd507a8568b6ee6f4897e9a8e3220f763 (patch) | |
tree | e9a45c0b7688a9881ea9ce132b92554ef2955ad6 /op_crates/crypto/lib.rs | |
parent | 284e6c303956e8ca20af63b4ecc045438a260fe6 (diff) |
refactor: convert ops to use serde_v8 (#10009)
This commit rewrites most of the ops to use "serde_v8" instead
of "json" serialization.
Diffstat (limited to 'op_crates/crypto/lib.rs')
-rw-r--r-- | op_crates/crypto/lib.rs | 8 |
1 files changed, 3 insertions, 5 deletions
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<ZeroCopyBuf>, -) -> Result<Value, AnyError> { +) -> Result<(), AnyError> { let mut zero_copy = zero_copy.ok_or_else(null_opbuf)?; let maybe_seeded_rng = state.try_borrow_mut::<StdRng>(); 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 { |