Insert parentheses as required
Since the fixed expression is used as a receiver for `.is_power_of_two()`, it may require parentheses.
This commit is contained in:
parent
bd2cb6a0af
commit
89385c135d
4 changed files with 16 additions and 2 deletions
|
|
@ -69,7 +69,7 @@ fn build_sugg(cx: &LateContext<'_>, expr: &Expr<'_>, receiver: &Expr<'_>) {
|
|||
expr.span,
|
||||
"manually reimplementing `is_power_of_two`",
|
||||
"consider using `.is_power_of_two()`",
|
||||
format!("{snippet}.is_power_of_two()"),
|
||||
format!("{}.is_power_of_two()", snippet.maybe_paren()),
|
||||
applicability,
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue