From 1ad097c4bf7fb6ba0c64c050224b39dba4ad8574 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bartek=20Iwa=C5=84czuk?= Date: Sat, 23 Sep 2023 14:04:47 +0200 Subject: refactor: rewrite ops using i64/usize to op2 (#20647) --- ext/fetch/lib.rs | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'ext/fetch') diff --git a/ext/fetch/lib.rs b/ext/fetch/lib.rs index dd3526ff8..589e6ebd8 100644 --- a/ext/fetch/lib.rs +++ b/ext/fetch/lib.rs @@ -20,7 +20,6 @@ use deno_core::futures::Future; use deno_core::futures::FutureExt; use deno_core::futures::Stream; use deno_core::futures::StreamExt; -use deno_core::op; use deno_core::op2; use deno_core::BufView; use deno_core::WriteOutcome; @@ -215,16 +214,18 @@ pub fn get_or_create_client_from_state( } } -#[op] +#[op2] +#[serde] +#[allow(clippy::too_many_arguments)] pub fn op_fetch( state: &mut OpState, - method: ByteString, - url: String, - headers: Vec<(ByteString, ByteString)>, - client_rid: Option, + #[serde] method: ByteString, + #[string] url: String, + #[serde] headers: Vec<(ByteString, ByteString)>, + #[smi] client_rid: Option, has_body: bool, - body_length: Option, - data: Option, + #[number] body_length: Option, + #[buffer] data: Option, ) -> Result where FP: FetchPermissions + 'static, -- cgit v1.2.3