From 0a771169b82744ce2427c906c6162546285c6889 Mon Sep 17 00:00:00 2001 From: Rosemary Ajayi Date: Sat, 23 Mar 2024 16:51:41 +0000 Subject: [PATCH] fix redundant closure (#31842) --- components/script/dom/windowproxy.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/script/dom/windowproxy.rs b/components/script/dom/windowproxy.rs index 6b9d44ba1c3..fc925b6431e 100644 --- a/components/script/dom/windowproxy.rs +++ b/components/script/dom/windowproxy.rs @@ -290,7 +290,7 @@ impl WindowProxy { let window = self .currently_active .get() - .and_then(|id| ScriptThread::find_document(id)) + .and_then(ScriptThread::find_document) .and_then(|doc| Some(DomRoot::from_ref(doc.window()))) .unwrap(); let msg = EmbedderMsg::AllowOpeningWebView(chan); @@ -303,7 +303,7 @@ impl WindowProxy { let document = self .currently_active .get() - .and_then(|id| ScriptThread::find_document(id)) + .and_then(ScriptThread::find_document) .expect("A WindowProxy creating an auxiliary to have an active document"); let blank_url = ServoUrl::parse("about:blank").ok().unwrap(); @@ -500,7 +500,7 @@ impl WindowProxy { let existing_document = self .currently_active .get() - .and_then(|id| ScriptThread::find_document(id)) + .and_then(ScriptThread::find_document) .unwrap(); // Step 14.1 let url = match existing_document.url().join(&url) { @@ -603,7 +603,7 @@ impl WindowProxy { pub fn document(&self) -> Option> { self.currently_active .get() - .and_then(|id| ScriptThread::find_document(id)) + .and_then(ScriptThread::find_document) } pub fn parent(&self) -> Option<&WindowProxy> {