servo: Merge #8685 - tidy rule to warn against use of &String and refactoring (from jmr0:master); r=Ms2ger

Fixes #8681

Source-Repo: https://github.com/servo/servo
Source-Revision: f96e8ce9e8c0a2c9de9574f538718defdcd93c11
This commit is contained in:
jmr0
2015-11-27 04:18:38 +05:00
parent 192058cf08
commit f50d4c7652
4 changed files with 11 additions and 7 deletions

View File

@@ -369,6 +369,10 @@ def check_rust(file_name, contents):
if ": &Vec<" in line:
yield (idx + 1, "use &[T] instead of &Vec<T>")
# No benefit over using &str
if ": &String" in line:
yield (idx + 1, "use &str instead of &String")
# Avoid flagging <Item=Foo> constructs
def is_associated_type(match, line, index):