Make request parameter immutable in send_response_to_devtools and send_early_httprequest_to_devtools (#38319)

- Changes request parameters to immutable borrow
Testing: 
Fixes: https://github.com/servo/servo/issues/38300

Signed-off-by: uthmaniv <uthmanyahayababa@gmail.com>
This commit is contained in:
Usman Yahaya Baba 2025-07-29 09:42:20 +09:00 committed by GitHub
parent d410236c87
commit 25822920cf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -433,11 +433,7 @@ pub fn send_request_to_devtools(
.unwrap(); .unwrap();
} }
pub fn send_response_to_devtools( pub fn send_response_to_devtools(request: &Request, context: &FetchContext, response: &Response) {
request: &mut Request,
context: &FetchContext,
response: &Response,
) {
if let (Some(devtools_chan), Some(pipeline_id), Some(webview_id)) = ( if let (Some(devtools_chan), Some(pipeline_id), Some(webview_id)) = (
context.devtools_chan.as_ref(), context.devtools_chan.as_ref(),
request.pipeline_id, request.pipeline_id,
@ -473,7 +469,7 @@ pub fn send_response_to_devtools(
} }
} }
pub fn send_early_httprequest_to_devtools(request: &mut Request, context: &FetchContext) { pub fn send_early_httprequest_to_devtools(request: &Request, context: &FetchContext) {
if let (Some(devtools_chan), Some(browsing_context_id), Some(pipeline_id)) = ( if let (Some(devtools_chan), Some(browsing_context_id), Some(pipeline_id)) = (
context.devtools_chan.as_ref(), context.devtools_chan.as_ref(),
request.target_webview_id.map(|id| id.0), request.target_webview_id.map(|id| id.0),