mirror of
https://github.com/servo/servo.git
synced 2025-07-22 23:03:42 +01:00
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:
parent
3651b650c4
commit
058319aa0b
12 changed files with 18 additions and 19 deletions
|
@ -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,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue