Skip to content

Commit 622197b

Browse files
committed
drive-by-cleanup: merge an early return into a match
1 parent c9537a9 commit 622197b

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

compiler/rustc_lint/src/unused.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -279,11 +279,9 @@ impl<'tcx> LateLintPass<'tcx> for UnusedResults {
279279
let parent_mod_did = cx.tcx.parent_module(expr.hir_id).to_def_id();
280280
let is_uninhabited =
281281
|t: Ty<'tcx>| !t.is_inhabited_from(cx.tcx, parent_mod_did, cx.typing_env());
282-
if is_uninhabited(ty) {
283-
return Some(MustUsePath::Suppressed);
284-
}
285282

286283
match *ty.kind() {
284+
_ if is_uninhabited(ty) => Some(MustUsePath::Suppressed),
287285
ty::Adt(..) if let Some(boxed) = ty.boxed_ty() => {
288286
is_ty_must_use(cx, boxed, expr, span)
289287
.map(|inner| MustUsePath::Boxed(Box::new(inner)))

0 commit comments

Comments
 (0)