diff options
author | Rosemary Ajayi <okhuomonajayi54@gmail.com> | 2024-03-20 18:41:07 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-20 18:41:07 +0000 |
commit | 058319aa0b9dbf1916dd87f27171bccd051be3e3 (patch) | |
tree | 0f3ba0d1322b8ac378fb37805f7720f00280625e /components/script/stylesheet_loader.rs | |
parent | 3651b650c48ba8cf1b8f00f4be9705ac11b68a8c (diff) | |
download | servo-058319aa0b9dbf1916dd87f27171bccd051be3e3.tar.gz servo-058319aa0b9dbf1916dd87f27171bccd051be3e3.zip |
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
Diffstat (limited to 'components/script/stylesheet_loader.rs')
-rw-r--r-- | components/script/stylesheet_loader.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/stylesheet_loader.rs b/components/script/stylesheet_loader.rs index 3b6c14525df..8ba0760840f 100644 --- a/components/script/stylesheet_loader.rs +++ b/components/script/stylesheet_loader.rs @@ -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, |