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:
lucantrop
2017-03-13 10:01:16 -07:00
parent 0aefbcf90e
commit 72a4fc3bbf
11 changed files with 33 additions and 30 deletions

View File

@@ -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: