Skip to content

Commit

Permalink
add &Root<T> checker
Browse files Browse the repository at this point in the history
update rust_tidy tests

update rust_tidy.rs and test_tidy.py
  • Loading branch information
mrmiywj committed Jun 5, 2016
1 parent c193af8 commit a17ae72
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 2 additions & 0 deletions python/tidy/servo_tidy/tidy.py
Expand Up @@ -387,6 +387,8 @@ 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),
# No benefit to using &Root<T>
(r": &Root<", "use &T instead of &Root<T>", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter),
]

Expand Down
2 changes: 1 addition & 1 deletion python/tidy/servo_tidy_tests/rust_tidy.rs
Expand Up @@ -35,7 +35,7 @@ impl test {
}
}

fn test_fun2(y : &String, z : &Vec<f32>) -> f32 {
fn test_fun2(y : &String, z : &Vec<f32>, r: &Root<isize>) -> f32 {
let x = true;
x
&& x;
Expand Down
1 change: 1 addition & 0 deletions python/tidy/servo_tidy_tests/test_tidy.py
Expand Up @@ -72,6 +72,7 @@ def test_rust(self):
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('use &T instead of &Root<T>', errors.next()[2])
self.assertEqual('operators should go at the end of the first line', errors.next()[2])
self.assertNoMoreErrors(errors)

Expand Down

0 comments on commit a17ae72

Please sign in to comment.