Files
servo/components/script/script_thread.rs
webbeef 17db529cb9 Reduce boilerplate in Constellation and ScriptThread (#34960)
The constellation has many cases of early returns in match expressions
that can be rewritten using `if let Some(...) = xyz else { return abc;
}`. Two macros are introduced to help with repetitive code blocks that
can't be extracted as functions.

<!-- Please describe your changes on the following line: -->


---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by
`[X]` when the step is complete, and replace `___` with appropriate
data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors


<!-- Also, please make sure that "Allow edits from maintainers" checkbox
is checked, so that we can help you if you get stuck somewhere along the
way.-->

<!-- Pull requests that do not address these steps are welcome, but they
will require additional verification as part of the review process. -->

Signed-off-by: webbeef <me@webbeef.org>
2025-11-07 08:48:29 +00:00

157 KiB