mirror of
https://github.com/servo/servo.git
synced 2025-07-23 15:23:42 +01: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 = []
|
mods = []
|
||||||
|
|
||||||
# There should not be any extra pointer dereferencing
|
# 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>")
|
yield (idx + 1, "use &[T] instead of &Vec<T>")
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue