summaryrefslogtreecommitdiff
path: root/ext/http/lib.rs
diff options
context:
space:
mode:
authorDivy Srivastava <dj.srivastava23@gmail.com>2022-07-04 21:48:09 +0530
committerGitHub <noreply@github.com>2022-07-04 21:48:09 +0530
commit93c03fffc49901e425a989cad801b492230273d8 (patch)
tree459057aa97e41f3e89c79233d35eac98a681015a /ext/http/lib.rs
parentdced4d5e19046ce14bed0ac73d172bd42932660e (diff)
perf(ext/http): remove accept_encoding interior mutability (#15070)
Diffstat (limited to 'ext/http/lib.rs')
-rw-r--r--ext/http/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/http/lib.rs b/ext/http/lib.rs
index 79a1bb624..6a900eb8e 100644
--- a/ext/http/lib.rs
+++ b/ext/http/lib.rs
@@ -307,7 +307,7 @@ pub struct HttpStreamResource {
conn: Rc<HttpConnResource>,
pub rd: AsyncRefCell<HttpRequestReader>,
wr: AsyncRefCell<HttpResponseWriter>,
- accept_encoding: RefCell<Encoding>,
+ accept_encoding: Encoding,
cancel_handle: CancelHandle,
}
@@ -322,7 +322,7 @@ impl HttpStreamResource {
conn: conn.clone(),
rd: HttpRequestReader::Headers(request).into(),
wr: HttpResponseWriter::Headers(response_tx).into(),
- accept_encoding: RefCell::new(accept_encoding),
+ accept_encoding,
cancel_handle: CancelHandle::new(),
}
}
@@ -491,7 +491,7 @@ async fn op_http_write_headers(
.get::<HttpStreamResource>(rid)?;
// Track supported encoding
- let encoding = *stream.accept_encoding.borrow();
+ let encoding = stream.accept_encoding;
let mut builder = Response::builder();
// SAFETY: can not fail, since a fresh Builder is non-errored