From 77a00ce1fb4ae2523e22b9b84ae09a0200502e38 Mon Sep 17 00:00:00 2001 From: Leo K Date: Tue, 5 Oct 2021 22:38:27 +0200 Subject: chore: various op cleanup (#12329) --- core/examples/http_bench_json_ops.rs | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'core/examples/http_bench_json_ops.rs') diff --git a/core/examples/http_bench_json_ops.rs b/core/examples/http_bench_json_ops.rs index d273c2c88..5989a472f 100644 --- a/core/examples/http_bench_json_ops.rs +++ b/core/examples/http_bench_json_ops.rs @@ -1,5 +1,4 @@ // Copyright 2018-2021 the Deno authors. All rights reserved. MIT license. -use deno_core::error::null_opbuf; use deno_core::error::AnyError; use deno_core::AsyncRefCell; use deno_core::CancelHandle; @@ -121,7 +120,7 @@ fn create_js_runtime() -> JsRuntime { fn op_listen( state: &mut OpState, - _args: (), + _: (), _: (), ) -> Result { log::debug!("listen"); @@ -158,9 +157,8 @@ async fn op_accept( async fn op_read( state: Rc>, rid: ResourceId, - buf: Option, + mut buf: ZeroCopyBuf, ) -> Result { - let mut buf = buf.ok_or_else(null_opbuf)?; log::debug!("read rid={}", rid); let stream = state.borrow().resource_table.get::(rid)?; @@ -171,9 +169,8 @@ async fn op_read( async fn op_write( state: Rc>, rid: ResourceId, - buf: Option, + buf: ZeroCopyBuf, ) -> Result { - let buf = buf.ok_or_else(null_opbuf)?; log::debug!("write rid={}", rid); let stream = state.borrow().resource_table.get::(rid)?; -- cgit v1.2.3