From c917670c9193d080fba7e8f5167f0f29752154fa Mon Sep 17 00:00:00 2001 From: Akshay Date: Sun, 20 Feb 2022 11:29:59 +0530 Subject: 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`. --- lib/src/lints/useless_has_attr.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib') 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 { | SyntaxKind::NODE_PAREN | SyntaxKind::NODE_STRING | SyntaxKind::NODE_ATTR_SET - | SyntaxKind::NODE_IDENT => default_expr, + | SyntaxKind::NODE_IDENT + | SyntaxKind::NODE_SELECT => default_expr, _ => make::parenthesize(&default_expr).node().clone(), }; let replacement = make::or_default(&set, &attr_path, &default_with_parens).node().clone(); -- cgit v1.2.3