fix clippy warning in components/script (#33878)

Signed-off-by: lwz23 <wenzhaoliao@ruc.edu.cn>
This commit is contained in:
lwz23 2024-10-17 08:58:28 -04:00 committed by GitHub
parent cd7b66be58
commit 595aab10dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 5 additions and 6 deletions

View file

@ -2157,7 +2157,7 @@ impl Document {
task_source,
canceller: Some(canceller),
}
.to_callback();
.into_callback();
self.loader_mut()
.fetch_async_with_callback(load, request, callback);
}
@ -2177,7 +2177,7 @@ impl Document {
task_source,
canceller: Some(canceller),
}
.to_callback();
.into_callback();
self.loader_mut()
.fetch_async_background(request, callback, cancel_override);
}

View file

@ -3424,7 +3424,7 @@ impl GlobalScope {
&self.core_resource_thread(),
request_builder,
cancellation_receiver,
network_listener.to_callback(),
network_listener.into_callback(),
);
}
}

View file

@ -345,7 +345,6 @@ pub fn load_whole_resource(
loop {
match action_receiver.recv().unwrap() {
FetchResponseMsg::ProcessRequestBody(..) | FetchResponseMsg::ProcessRequestEOF(..) => {
()
},
FetchResponseMsg::ProcessResponse(_, Ok(m)) => {
metadata = Some(match m {

View file

@ -91,7 +91,7 @@ impl<Listener: FetchResponseListener + PreInvoke + Send + 'static> NetworkListen
self.notify(action);
}
pub fn to_callback(self) -> BoxedFetchCallback {
pub fn into_callback(self) -> BoxedFetchCallback {
Box::new(move |response_msg| self.notify_fetch(response_msg))
}
}

View file

@ -1687,7 +1687,7 @@ fn fetch_single_module_script(
document.loader_mut().fetch_async_with_callback(
LoadType::Script(url),
request,
network_listener.to_callback(),
network_listener.into_callback(),
);
},
None => global.fetch_with_network_listener(request, network_listener, None),