servo: Merge #15927 - added tidiness check for "-> ()" (from lucantrop:master); r=Ms2ger
<!-- Please describe your changes on the following line: --> I added the check, modified the tests and removed all instances of "-> ()" that were already there. --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `__` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #15925 (github issue number if applicable). <!-- Either: --> - [X] There are tests for these changes <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: a6f89c503671726bcb0407cd84c380f3af4a7916
This commit is contained in:
@@ -565,6 +565,8 @@ def check_rust(file_name, lines):
|
||||
# This particular pattern is not reentrant-safe in script_thread.rs
|
||||
(r"match self.documents.borrow", "use a separate variable for the match expression",
|
||||
lambda match, line: file_name.endswith('script_thread.rs')),
|
||||
# -> () is unnecessary
|
||||
(r"-> \(\)", "encountered function signature with -> ()", no_filter),
|
||||
]
|
||||
|
||||
for pattern, message, filter_func in regex_rules:
|
||||
|
||||
Reference in New Issue
Block a user