aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/worker.rs
diff options
context:
space:
mode:
authorOluwatobi Sofela <60105594+oluwatobiss@users.noreply.github.com>2024-03-27 19:43:56 +0100
committerGitHub <noreply@github.com>2024-03-27 18:43:56 +0000
commitda76ebabe9359c6f815f16adc81af7f11bb3265c (patch)
tree80a732b845fda22ce172f48dccedbb6d11efbefa /components/script/dom/worker.rs
parenta5bcae212a175d89507bffba7c57313b2cc9b3ab (diff)
downloadservo-da76ebabe9359c6f815f16adc81af7f11bb3265c.tar.gz
servo-da76ebabe9359c6f815f16adc81af7f11bb3265c.zip
clippy: Fix option_map_unit_fn warnings (#31906)
Diffstat (limited to 'components/script/dom/worker.rs')
-rw-r--r--components/script/dom/worker.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/components/script/dom/worker.rs b/components/script/dom/worker.rs
index 9ffdcefae0c..33c5922de85 100644
--- a/components/script/dom/worker.rs
+++ b/components/script/dom/worker.rs
@@ -267,10 +267,9 @@ impl WorkerMethods for Worker {
self.terminated.set(true);
// Step 3
- self.context_for_interrupt
- .borrow()
- .as_ref()
- .map(|cx| cx.request_interrupt());
+ if let Some(cx) = self.context_for_interrupt.borrow().as_ref() {
+ cx.request_interrupt()
+ }
}
// https://html.spec.whatwg.org/multipage/#handler-worker-onmessage