servo: Merge #7945 - Refactor away unnecessary use of regex (from pierrechevalier83:fix_issue_7914); r=jdm
We don't need regex matching since ": &Vec<" doesn't contain any special character. New code reads better. Fixes #7914. Source-Repo: https://github.com/servo/servo Source-Revision: 1192efed505ca19a395f22cd5e5733e8c57a6e82
This commit is contained in:
@@ -351,7 +351,7 @@ def check_rust(file_name, contents):
|
||||
mods = []
|
||||
|
||||
# There should not be any extra pointer dereferencing
|
||||
if re.search(r": &Vec<", line) is not None:
|
||||
if ": &Vec<" in line:
|
||||
yield (idx + 1, "use &[T] instead of &Vec<T>")
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user