simplified chain

This commit is contained in:
Jeroen Vannevel 2022-01-10 18:38:17 +00:00
parent 5dfc8da77e
commit 130f11f270
No known key found for this signature in database
GPG key ID: 78EF5F52F38C49BD

View file

@ -113,14 +113,9 @@ fn are_same_types(
fn get_arm_types(ctx: &AssistContext, arm: &ast::MatchArm) -> Vec<Option<hir::TypeInfo>> {
match arm.pat() {
Some(ast::Pat::TupleStructPat(tp)) => tp
.fields()
.into_iter()
.map(|field| {
let pat_type = ctx.sema.type_of_pat(&field);
pat_type
})
.collect_vec(),
Some(ast::Pat::TupleStructPat(tp)) => {
tp.fields().into_iter().map(|field| ctx.sema.type_of_pat(&field)).collect_vec()
}
_ => Vec::new(),
}
}