aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/code_model_impl/function.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src/code_model_impl/function.rs')
-rw-r--r--crates/ra_hir/src/code_model_impl/function.rs10
1 files changed, 4 insertions, 6 deletions
diff --git a/crates/ra_hir/src/code_model_impl/function.rs b/crates/ra_hir/src/code_model_impl/function.rs
index f4beab6ae..e0dd4d629 100644
--- a/crates/ra_hir/src/code_model_impl/function.rs
+++ b/crates/ra_hir/src/code_model_impl/function.rs
@@ -32,7 +32,7 @@ impl FnSignature {
32 .name() 32 .name()
33 .map(|n| n.as_name()) 33 .map(|n| n.as_name())
34 .unwrap_or_else(Name::missing); 34 .unwrap_or_else(Name::missing);
35 let mut args = Vec::new(); 35 let mut params = Vec::new();
36 let mut has_self_param = false; 36 let mut has_self_param = false;
37 if let Some(param_list) = node.param_list() { 37 if let Some(param_list) = node.param_list() {
38 if let Some(self_param) = param_list.self_param() { 38 if let Some(self_param) = param_list.self_param() {
@@ -50,15 +50,14 @@ impl FnSignature {
50 } 50 }
51 } 51 }
52 }; 52 };
53 args.push(self_type); 53 params.push(self_type);
54 has_self_param = true; 54 has_self_param = true;
55 } 55 }
56 for param in param_list.params() { 56 for param in param_list.params() {
57 let type_ref = TypeRef::from_ast_opt(param.type_ref()); 57 let type_ref = TypeRef::from_ast_opt(param.type_ref());
58 args.push(type_ref); 58 params.push(type_ref);
59 } 59 }
60 } 60 }
61 let type_params = db.generic_params(func.into());
62 let ret_type = if let Some(type_ref) = node.ret_type().and_then(|rt| rt.type_ref()) { 61 let ret_type = if let Some(type_ref) = node.ret_type().and_then(|rt| rt.type_ref()) {
63 TypeRef::from_ast(type_ref) 62 TypeRef::from_ast(type_ref)
64 } else { 63 } else {
@@ -67,8 +66,7 @@ impl FnSignature {
67 66
68 let sig = FnSignature { 67 let sig = FnSignature {
69 name, 68 name,
70 type_params, 69 params,
71 args,
72 ret_type, 70 ret_type,
73 has_self_param, 71 has_self_param,
74 }; 72 };