Fix missing leading space in suggestion
For a local pattern with no space between `let` and `(` e.g.: let(_a) = 3; we were previously suggesting this illegal code: let_a =3; After this change the suggestion will instead be: let _a =3; (Note the space after `let`)
This commit is contained in:
parent
91bbdd927a
commit
a2486dba3b
4 changed files with 90 additions and 2 deletions
|
@ -1154,7 +1154,7 @@ impl EarlyLintPass for UnusedParens {
|
|||
|
||||
fn check_stmt(&mut self, cx: &EarlyContext<'_>, s: &ast::Stmt) {
|
||||
if let StmtKind::Local(ref local) = s.kind {
|
||||
self.check_unused_parens_pat(cx, &local.pat, true, false, (false, false));
|
||||
self.check_unused_parens_pat(cx, &local.pat, true, false, (true, false));
|
||||
}
|
||||
|
||||
<Self as UnusedDelimLint>::check_stmt(self, cx, s)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue