mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
convert IdentPat to Pat via Into
before child getter was used
This commit is contained in:
parent
1e6f13a0be
commit
88b3034636
1 changed files with 5 additions and 5 deletions
|
@ -107,14 +107,14 @@ pub(crate) fn extract_function(acc: &mut Assists, ctx: &AssistContext) -> Option
|
|||
let params = param_pats
|
||||
.into_iter()
|
||||
.map(|pat| {
|
||||
let ty = pat
|
||||
.pat()
|
||||
.and_then(|pat| ctx.sema.type_of_pat(&pat))
|
||||
let name = pat.name().unwrap().to_string();
|
||||
|
||||
let ty = ctx
|
||||
.sema
|
||||
.type_of_pat(&pat.into())
|
||||
.and_then(|ty| ty.display_source_code(ctx.db(), module.into()).ok())
|
||||
.unwrap_or_else(|| "()".to_string());
|
||||
|
||||
let name = pat.name().unwrap().to_string();
|
||||
|
||||
Param { name, ty }
|
||||
})
|
||||
.collect::<Vec<_>>();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue