Fix panicking Option unwraping in match arm analysis

This commit is contained in:
Neel Yadav 2022-11-30 20:14:06 -06:00
parent fb39efe26c
commit 9721505bf1
No known key found for this signature in database
GPG key ID: ED84CBAAA8A7B576

View file

@ -87,7 +87,7 @@ fn find_arms(
let mut extracting = None;
let mut diverging = None;
for arm in arms {
if ctx.sema.type_of_expr(&arm.expr().unwrap()).unwrap().original().is_never() {
if ctx.sema.type_of_expr(&arm.expr()?)?.original().is_never() {
diverging = Some(arm);
} else {
extracting = Some(arm);