Fix missing parenthesis in suboptimal floating point help
This commit is contained in:
parent
2f0f4ddcf7
commit
1ed1001440
5 changed files with 22 additions and 19 deletions
|
|
@ -465,7 +465,10 @@ forward_binop_impls_to_ref!(impl Sub, sub for Sugg<'_>, type Output = Sugg<'stat
|
|||
impl Neg for Sugg<'_> {
|
||||
type Output = Sugg<'static>;
|
||||
fn neg(self) -> Sugg<'static> {
|
||||
make_unop("-", self)
|
||||
match &self {
|
||||
Self::BinOp(AssocOp::As, ..) => Sugg::MaybeParen(format!("-({self})").into()),
|
||||
_ => make_unop("-", self),
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue