diff options
author | Akshay <[email protected]> | 2022-02-20 05:59:59 +0000 |
---|---|---|
committer | Akshay <[email protected]> | 2022-02-20 05:59:59 +0000 |
commit | c917670c9193d080fba7e8f5167f0f29752154fa (patch) | |
tree | 71c081edfa7e368d6e15e23be2dea2297275d673 /lib/src/lints | |
parent | 44865fcb29051ac06e981689b8673513690f6f3e (diff) |
useless_has_attr: do not parenthesize select expressions in fixes
`select` expresisons are more tightly binding than `or` expressions,
we do not have to parenthesize them when placed next to an `or`.
Diffstat (limited to 'lib/src/lints')
-rw-r--r-- | lib/src/lints/useless_has_attr.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/src/lints/useless_has_attr.rs b/lib/src/lints/useless_has_attr.rs index aae560a..2dbdb5b 100644 --- a/lib/src/lints/useless_has_attr.rs +++ b/lib/src/lints/useless_has_attr.rs | |||
@@ -63,7 +63,8 @@ impl Rule for UselessHasAttr { | |||
63 | | SyntaxKind::NODE_PAREN | 63 | | SyntaxKind::NODE_PAREN |
64 | | SyntaxKind::NODE_STRING | 64 | | SyntaxKind::NODE_STRING |
65 | | SyntaxKind::NODE_ATTR_SET | 65 | | SyntaxKind::NODE_ATTR_SET |
66 | | SyntaxKind::NODE_IDENT => default_expr, | 66 | | SyntaxKind::NODE_IDENT |
67 | | SyntaxKind::NODE_SELECT => default_expr, | ||
67 | _ => make::parenthesize(&default_expr).node().clone(), | 68 | _ => make::parenthesize(&default_expr).node().clone(), |
68 | }; | 69 | }; |
69 | let replacement = make::or_default(&set, &attr_path, &default_with_parens).node().clone(); | 70 | let replacement = make::or_default(&set, &attr_path, &default_with_parens).node().clone(); |