diff options
-rw-r--r-- | crates/ide/src/display.rs | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crates/ide/src/display.rs b/crates/ide/src/display.rs index 5bb065fc1..2484dbbf1 100644 --- a/crates/ide/src/display.rs +++ b/crates/ide/src/display.rs | |||
@@ -41,11 +41,12 @@ pub(crate) fn function_declaration(node: &ast::Fn) -> String { | |||
41 | format_to!(buf, "{}", type_params); | 41 | format_to!(buf, "{}", type_params); |
42 | } | 42 | } |
43 | if let Some(param_list) = node.param_list() { | 43 | if let Some(param_list) = node.param_list() { |
44 | let mut params = match param_list.self_param() { | 44 | let params: Vec<String> = param_list |
45 | Some(self_param) => vec![self_param.to_string()], | 45 | .self_param() |
46 | None => vec![], | 46 | .into_iter() |
47 | }; | 47 | .map(|self_param| self_param.to_string()) |
48 | params.extend(param_list.params().map(|param| param.to_string())); | 48 | .chain(param_list.params().map(|param| param.to_string())) |
49 | .collect(); | ||
49 | // Useful to inline parameters | 50 | // Useful to inline parameters |
50 | format_to!(buf, "({})", params.join(", ")); | 51 | format_to!(buf, "({})", params.join(", ")); |
51 | } | 52 | } |