diff options
Diffstat (limited to 'crates')
-rw-r--r-- | crates/assists/src/handlers/extract_function.rs | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crates/assists/src/handlers/extract_function.rs b/crates/assists/src/handlers/extract_function.rs index 09c2a9bc7..218529fcf 100644 --- a/crates/assists/src/handlers/extract_function.rs +++ b/crates/assists/src/handlers/extract_function.rs | |||
@@ -107,14 +107,14 @@ pub(crate) fn extract_function(acc: &mut Assists, ctx: &AssistContext) -> Option | |||
107 | let params = param_pats | 107 | let params = param_pats |
108 | .into_iter() | 108 | .into_iter() |
109 | .map(|pat| { | 109 | .map(|pat| { |
110 | let ty = pat | 110 | let name = pat.name().unwrap().to_string(); |
111 | .pat() | 111 | |
112 | .and_then(|pat| ctx.sema.type_of_pat(&pat)) | 112 | let ty = ctx |
113 | .sema | ||
114 | .type_of_pat(&pat.into()) | ||
113 | .and_then(|ty| ty.display_source_code(ctx.db(), module.into()).ok()) | 115 | .and_then(|ty| ty.display_source_code(ctx.db(), module.into()).ok()) |
114 | .unwrap_or_else(|| "()".to_string()); | 116 | .unwrap_or_else(|| "()".to_string()); |
115 | 117 | ||
116 | let name = pat.name().unwrap().to_string(); | ||
117 | |||
118 | Param { name, ty } | 118 | Param { name, ty } |
119 | }) | 119 | }) |
120 | .collect::<Vec<_>>(); | 120 | .collect::<Vec<_>>(); |