From d2481c37d5ff0da67b86f09aa23cd9decad7cafe Mon Sep 17 00:00:00 2001 From: Pierre Chevalier Date: Fri, 9 Oct 2015 16:39:18 +0100 Subject: [PATCH] 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. --- python/tidy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/tidy.py b/python/tidy.py index 93b30e147f9..432814e8f93 100644 --- a/python/tidy.py +++ b/python/tidy.py @@ -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")