adding tidy rule to warn against use of &String and refactoring instances of &String in codebase

This commit is contained in:
jmr0 2015-11-25 21:49:12 -05:00
parent 8efc954531
commit df49cf2b13
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):