mirror of
https://github.com/rust-lang/rust-analyzer
synced 2025-01-13 05:38:46 +00:00
simplified chain
This commit is contained in:
parent
5dfc8da77e
commit
130f11f270
1 changed files with 3 additions and 8 deletions
|
@ -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(),
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue