Skip to content

Commit

Permalink
Remove redundant to_strings in if_then_panic.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
smoelius committed Oct 3, 2021
1 parent cbe4942 commit 032ae17
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clippy_lints/src/if_then_panic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,10 @@ impl LateLintPass<'_> for IfThenPanic {
if let Expr{kind: ExprKind::Unary(UnOp::Not, not_expr), ..} = e {
sugg::Sugg::hir_with_applicability(cx, not_expr, "..", &mut applicability).maybe_par().to_string()
} else {
format!("!{}", sugg::Sugg::hir_with_applicability(cx, e, "..", &mut applicability).maybe_par().to_string())
format!("!{}", sugg::Sugg::hir_with_applicability(cx, e, "..", &mut applicability).maybe_par())
}
} else {
format!("!{}", sugg::Sugg::hir_with_applicability(cx, cond, "..", &mut applicability).maybe_par().to_string())
format!("!{}", sugg::Sugg::hir_with_applicability(cx, cond, "..", &mut applicability).maybe_par())
};

span_lint_and_sugg(
Expand Down

0 comments on commit 032ae17

Please sign in to comment.