clippy: Fix some clippy problems in components/script (#31778)

* fix clippy problems in stylesheet

* fix clippy problems in task_manager

* fix clippy problems in task_queue

* fix clippy problems in task_queue

* fix clippy problems in file_reading

* fix clippy problems in dom_manipulation

* fix clippy problems in gamepad

* fix clippy problems in networking

* fix clippy problems in performance

* fix clippy problems in port_message

* fix clippy problems in port_message

* fix clippy problems in timer

* fix clippy problems in stylesheet

* fix clippy problems

* fix clippy problems

* fix clippy problems
This commit is contained in:
Rosemary Ajayi 2024-03-20 18:41:07 +00:00 committed by GitHub
parent 3651b650c4
commit 058319aa0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 18 additions and 19 deletions

View file

@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */
use std::mem;
use std::sync::atomic::AtomicBool;
use std::sync::Mutex;
@ -134,14 +133,14 @@ impl FetchResponseListener for StylesheetContext {
});
let data = if is_css {
mem::replace(&mut self.data, vec![])
std::mem::take(&mut self.data)
} else {
vec![]
};
// TODO: Get the actual value. http://dev.w3.org/csswg/css-syntax/#environment-encoding
let environment_encoding = UTF_8;
let protocol_encoding_label = metadata.charset.as_ref().map(|s| &**s);
let protocol_encoding_label = metadata.charset.as_deref();
let final_url = metadata.final_url;
let win = window_from_node(&*elem);
@ -277,7 +276,7 @@ impl<'a> StylesheetLoader<'a> {
.downcast::<HTMLLinkElement>()
.map(HTMLLinkElement::get_request_generation_id);
let context = ::std::sync::Arc::new(Mutex::new(StylesheetContext {
elem: Trusted::new(&*self.elem),
elem: Trusted::new(self.elem),
source: source,
url: url.clone(),
metadata: None,