Skip to content

Commit f051185

Browse files
Don't mix combinators and let else
Co-authored-by: Michael Goulet <[email protected]>
1 parent 4b2e8bc commit f051185

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

compiler/rustc_mir_build/src/thir/pattern/check_match.rs

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -430,9 +430,12 @@ impl<'p, 'tcx> MatchVisitor<'p, 'tcx> {
430430
}
431431

432432
let scrut_ty = scrut.ty;
433-
let Ok(report) = analyze_match(&cx, &tarms, scrut_ty).map_err(|err| self.error = Err(err))
434-
else {
435-
return;
433+
let report = match analyze_match(&cx, &tarms, scrut_ty) {
434+
Ok(report) => report,
435+
Err(err) => {
436+
self.error = Err(err);
437+
return;
438+
}
436439
};
437440

438441
match source {

0 commit comments

Comments
 (0)