summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-04-04 15:19:35 +0530
committerGitHub <noreply@github.com>2022-04-04 15:19:35 +0530
commitcc49b5e0d80f0c27e90af6ae520a0fec59e577c6 (patch)
treef31463336c7b02ede9d6901ad16bfde8f3a6abb2 /ext/http/lib.rs
parent6bb555b549a203ebe921260379f3da70787be655 (diff)
chore(ext/http): custom arity (#14200)
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs17
1 files changed, 3 insertions, 14 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index f0b4588c6..9c0109937 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -43,7 +43,6 @@ use hyper::service::Service;
use hyper::Body;
use hyper::Request;
use hyper::Response;
-use serde::Deserialize;
use serde::Serialize;
use std::borrow::Cow;
use std::cell::RefCell;
@@ -481,24 +480,14 @@ fn req_headers(
headers
}
-// We use a tuple instead of struct to avoid serialization overhead of the keys.
-#[derive(Deserialize)]
-struct RespondArgs(
- // rid:
- u32,
- // status:
- u16,
- // headers:
- Vec<(ByteString, ByteString)>,
-);
-
#[op]
async fn op_http_write_headers(
state: Rc<RefCell<OpState>>,
- args: RespondArgs,
+ rid: u32,
+ status: u16,
+ headers: Vec<(ByteString, ByteString)>,
data: Option<StringOrBuffer>,
) -> Result<(), AnyError> {
- let RespondArgs(rid, status, headers) = args;
let stream = state
.borrow_mut()
.resource_table