mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
adding tidy rule to warn against use of &String and refactoring instances of &String in codebase
This commit is contained in:
parent
8efc954531
commit
df49cf2b13
4 changed files with 11 additions and 7 deletions
|
@ -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):
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue