Report use statements that use {} with only one entry

This commit is contained in:
Cullen Rhodes 2016-05-22 16:32:18 +01:00
parent 4dcb05ca4f
commit 40acd24e8f
55 changed files with 92 additions and 89 deletions

View file

@ -390,6 +390,8 @@ def check_rust(file_name, lines):
# No benefit over using &str
(r": &String", "use &str instead of &String", no_filter),
(r"^&&", "operators should go at the end of the first line", no_filter),
(r"\{[A-Za-z0-9_]+\};", "use statement contains braces for single import",
lambda match, line: line.startswith('use ')),
]
for pattern, message, filter_func in regex_rules: