mirror of
https://github.com/servo/servo.git
synced 2025-06-08 00:23:30 +00:00
Refactor away unnecessary use of regex
We don't need regex matching since ": &Vec<" doesn't contain any special character. New code reads better. Fixes #7914.
This commit is contained in:
parent
1029feb55d
commit
d2481c37d5
1 changed files with 1 additions and 1 deletions
|
@ -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>")
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue