We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Ty::is_unit
1 parent af2dd2d commit 8725facCopy full SHA for 8725fac
clippy_lints/src/unnecessary_semicolon.rs
@@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessarySemicolon {
86
expr.kind,
87
ExprKind::If(..) | ExprKind::Match(_, _, MatchSource::Normal | MatchSource::Postfix)
88
)
89
- && cx.typeck_results().expr_ty(expr) == cx.tcx.types.unit
+ && cx.typeck_results().expr_ty(expr).is_unit()
90
// if a stmt has attrs, then turning it into an expr will break the code, since attrs aren't allowed on exprs
91
&& cx.tcx.hir_attrs(stmt.hir_id).is_empty()
92
{
0 commit comments