From b9dc228e515cf8a211580d05a53cbb3a917a64cb Mon Sep 17 00:00:00 2001 From: Jonathan Schwender <55576758+jschwe@users.noreply.github.com> Date: Mon, 25 Aug 2025 21:16:12 +0200 Subject: [PATCH] script: Clean-up IpcSend .sender().send() pattern (#38919) The IpcSend trait defines a `send()` method, so doing .sender().send() seems like it just adds a useless clone of the sender, when we could just `send()` directly. This only cleans up the direct usages of this pattern, there are more instances, where a helper method is defined, which returns the IpcSender, and the only usages also just directly call send. Testing: No functional changes Signed-off-by: Jonathan Schwender --- components/script/dom/idbobjectstore.rs | 1 - components/script/dom/idbopendbrequest.rs | 2 -- components/script/dom/idbrequest.rs | 1 - components/script/dom/idbtransaction.rs | 1 - components/script/dom/windowproxy.rs | 7 +------ 5 files changed, 1 insertion(+), 11 deletions(-) diff --git a/components/script/dom/idbobjectstore.rs b/components/script/dom/idbobjectstore.rs index 30b9f3345c0..618dc644c17 100644 --- a/components/script/dom/idbobjectstore.rs +++ b/components/script/dom/idbobjectstore.rs @@ -128,7 +128,6 @@ impl IDBObjectStore { self.global() .resource_threads() - .sender() .send(IndexedDBThreadMsg::Sync(operation)) .unwrap(); diff --git a/components/script/dom/idbopendbrequest.rs b/components/script/dom/idbopendbrequest.rs index 1b5bc12038a..e1c22ab8e9b 100644 --- a/components/script/dom/idbopendbrequest.rs +++ b/components/script/dom/idbopendbrequest.rs @@ -288,7 +288,6 @@ impl IDBOpenDBRequest { global .resource_threads() - .sender() .send(IndexedDBThreadMsg::Sync(open_operation)) .unwrap(); } @@ -320,7 +319,6 @@ impl IDBOpenDBRequest { global .resource_threads() - .sender() .send(IndexedDBThreadMsg::Sync(delete_operation)) .unwrap(); } diff --git a/components/script/dom/idbrequest.rs b/components/script/dom/idbrequest.rs index 649ae9eed93..f5b74d35a25 100644 --- a/components/script/dom/idbrequest.rs +++ b/components/script/dom/idbrequest.rs @@ -308,7 +308,6 @@ impl IDBRequest { transaction .global() .resource_threads() - .sender() .send(IndexedDBThreadMsg::Async( global.origin().immutable().clone(), transaction.get_db_name().to_string(), diff --git a/components/script/dom/idbtransaction.rs b/components/script/dom/idbtransaction.rs index a386cc23bf7..18b8e5414d6 100644 --- a/components/script/dom/idbtransaction.rs +++ b/components/script/dom/idbtransaction.rs @@ -105,7 +105,6 @@ impl IDBTransaction { global .resource_threads() - .sender() .send(IndexedDBThreadMsg::Sync(SyncOperation::RegisterNewTxn( sender, global.origin().immutable().clone(), diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index 022a940adc1..e2d5a2154ca 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -356,12 +356,7 @@ impl WindowProxy { dest: response.new_webview_id, }; - document - .global() - .resource_threads() - .sender() - .send(msg) - .unwrap(); + document.global().resource_threads().send(msg).unwrap(); receiver.recv().unwrap(); } Some(new_window_proxy)