From 028026bebe992431ede7c57b7e3065616d859026 Mon Sep 17 00:00:00 2001 From: komuhangi <51232461+jahielkomu@users.noreply.github.com> Date: Mon, 7 Oct 2024 19:32:48 +0300 Subject: [PATCH] Fixed some clippy warnings in components/script and components/devtools (#33689) Signed-off-by: jahielkomu --- components/devtools/actors/inspector/style_rule.rs | 6 +++--- components/script/dom/identityhub.rs | 6 ------ components/script/dom/serviceworkerglobalscope.rs | 2 +- components/script/script_thread.rs | 2 +- 4 files changed, 5 insertions(+), 11 deletions(-) diff --git a/components/devtools/actors/inspector/style_rule.rs b/components/devtools/actors/inspector/style_rule.rs index a2e03c50859..15c39e48903 100644 --- a/components/devtools/actors/inspector/style_rule.rs +++ b/components/devtools/actors/inspector/style_rule.rs @@ -185,8 +185,8 @@ impl StyleRuleActor { css_text: "".into(), // TODO: Specify the css text declarations: style .into_iter() - .filter_map(|decl| { - Some(AppliedDeclaration { + .map(|decl| { + AppliedDeclaration { colon_offsets: vec![], is_name_valid: true, is_used: IsUsed { used: true }, @@ -196,7 +196,7 @@ impl StyleRuleActor { priority: decl.priority, terminator: "".into(), value: decl.value, - }) + } }) .collect(), href: node.base_uri.clone(), diff --git a/components/script/dom/identityhub.rs b/components/script/dom/identityhub.rs index 81831be9202..c98618e97f0 100644 --- a/components/script/dom/identityhub.rs +++ b/components/script/dom/identityhub.rs @@ -38,12 +38,6 @@ pub struct IdentityHub { impl Default for IdentityHub { fn default() -> Self { - Self::new() - } -} - -impl IdentityHub { - pub fn new() -> Self { IdentityHub { adapters: IdentityManager::new(), devices: IdentityManager::new(), diff --git a/components/script/dom/serviceworkerglobalscope.rs b/components/script/dom/serviceworkerglobalscope.rs index fb4c351444a..ae39142e0d6 100644 --- a/components/script/dom/serviceworkerglobalscope.rs +++ b/components/script/dom/serviceworkerglobalscope.rs @@ -241,7 +241,7 @@ impl ServiceWorkerGlobalScope { runtime, from_devtools_receiver, closing, - Arc::new(IdentityHub::new()), + Arc::new(IdentityHub::default()), ), task_queue: TaskQueue::new(receiver, own_sender.clone()), own_sender, diff --git a/components/script/script_thread.rs b/components/script/script_thread.rs index 6da64d32786..e170dfcaa9d 100644 --- a/components/script/script_thread.rs +++ b/components/script/script_thread.rs @@ -1417,7 +1417,7 @@ impl ScriptThread { node_ids: Default::default(), is_user_interacting: Cell::new(false), - gpu_id_hub: Arc::new(IdentityHub::new()), + gpu_id_hub: Arc::new(IdentityHub::default()), webgpu_port: RefCell::new(None), inherited_secure_context: state.inherited_secure_context, layout_factory,