From f62ce062639392c9ab02d3044b366f6356b16107 Mon Sep 17 00:00:00 2001 From: Divy Srivastava Date: Mon, 4 Jul 2022 21:48:09 +0530 Subject: [PATCH] perf(ext/http): remove accept_encoding interior mutability (#15070) --- ext/http/lib.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ext/http/lib.rs b/ext/http/lib.rs index 79a1bb624b..6a900eb8ea 100644 --- a/ext/http/lib.rs +++ b/ext/http/lib.rs @@ -307,7 +307,7 @@ pub struct HttpStreamResource { conn: Rc, pub rd: AsyncRefCell, wr: AsyncRefCell, - accept_encoding: RefCell, + 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::(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