mirror of
https://github.com/servo/servo.git
synced 2025-06-06 16:45:39 +00:00
Report lines starting with &&.
This commit is contained in:
parent
924d804583
commit
39780ca39f
3 changed files with 6 additions and 1 deletions
|
@ -378,6 +378,7 @@ def check_rust(file_name, lines):
|
|||
(r": &Vec<", "use &[T] instead of &Vec<T>", no_filter),
|
||||
# No benefit over using &str
|
||||
(r": &String", "use &str instead of &String", no_filter),
|
||||
(r"^&&", "operators should go at the end of the first line", no_filter),
|
||||
]
|
||||
|
||||
for pattern, message, filter_func in regex_rules:
|
||||
|
|
|
@ -32,6 +32,9 @@ impl test {
|
|||
}
|
||||
|
||||
fn test_fun2(y : &String, z : &Vec<f32>) -> f32 {
|
||||
1
|
||||
let x = true;
|
||||
x
|
||||
&& x;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -70,6 +70,7 @@ class CheckTidiness(unittest.TestCase):
|
|||
self.assertEqual('extra space before :', errors.next()[2])
|
||||
self.assertEqual('use &[T] instead of &Vec<T>', errors.next()[2])
|
||||
self.assertEqual('use &str instead of &String', errors.next()[2])
|
||||
self.assertEqual('operators should go at the end of the first line', errors.next()[2])
|
||||
self.assertNoMoreErrors(errors)
|
||||
|
||||
def test_spec_link(self):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue