Skip to content

Commit 8725fac

Browse files
committed
misc: use Ty::is_unit
1 parent af2dd2d commit 8725fac

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

clippy_lints/src/unnecessary_semicolon.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ impl<'tcx> LateLintPass<'tcx> for UnnecessarySemicolon {
8686
expr.kind,
8787
ExprKind::If(..) | ExprKind::Match(_, _, MatchSource::Normal | MatchSource::Postfix)
8888
)
89-
&& cx.typeck_results().expr_ty(expr) == cx.tcx.types.unit
89+
&& cx.typeck_results().expr_ty(expr).is_unit()
9090
// if a stmt has attrs, then turning it into an expr will break the code, since attrs aren't allowed on exprs
9191
&& cx.tcx.hir_attrs(stmt.hir_id).is_empty()
9292
{

0 commit comments

Comments
 (0)