aboutsummaryrefslogtreecommitdiffstats
path: root/python/tidy.py
diff options
context:
space:
mode:
authorjmr0 <jrosello720@gmail.com>2015-11-25 21:49:12 -0500
committerjmr0 <jrosello720@gmail.com>2015-11-25 21:49:12 -0500
commitdf49cf2b132ae89ac71f316efd2e40a6f74dab2c (patch)
treea0a9cd5d5aca9eb62e550bd29ccd3c215344dca5 /python/tidy.py
parent8efc954531d2c7491ea01b6e22c89e35c5cf434a (diff)
downloadservo-df49cf2b132ae89ac71f316efd2e40a6f74dab2c.tar.gz
servo-df49cf2b132ae89ac71f316efd2e40a6f74dab2c.zip
adding tidy rule to warn against use of &String and refactoring instances of &String in codebase
Diffstat (limited to 'python/tidy.py')
-rw-r--r--python/tidy.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/python/tidy.py b/python/tidy.py
index dd2ef9d29cc..499fb8c5efc 100644
--- a/python/tidy.py
+++ b/python/tidy.py
@@ -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):