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:
@@ -38,7 +38,7 @@ impl test {
|
||||
}
|
||||
}
|
||||
|
||||
fn test_fun2(y : &String, z : &Vec<f32>, r: &Root<isize>) -> f32 {
|
||||
fn test_fun2(y : &String, z : &Vec<f32>, r: &Root<isize>) -> () {
|
||||
let x = true;
|
||||
x
|
||||
&& x;
|
||||
|
||||
@@ -123,6 +123,7 @@ class CheckTidiness(unittest.TestCase):
|
||||
self.assertEqual('use &[T] instead of &Vec<T>', errors.next()[2])
|
||||
self.assertEqual('use &str instead of &String', errors.next()[2])
|
||||
self.assertEqual('use &T instead of &Root<T>', errors.next()[2])
|
||||
self.assertEqual('encountered function signature with -> ()', errors.next()[2])
|
||||
self.assertEqual('operators should go at the end of the first line', errors.next()[2])
|
||||
self.assertEqual('else braces should be on the same line', errors.next()[2])
|
||||
self.assertEqual('extra space after (', errors.next()[2])
|
||||
|
||||
Reference in New Issue
Block a user