diff options
author | Aleksey Kladov <[email protected]> | 2019-04-13 07:33:34 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2019-04-13 07:33:34 +0100 |
commit | 65b00736535255c089cfef58c7b4eb13d4d8dbad (patch) | |
tree | cfde3d7724d9e7086514a5d836cac57cae0c99be /crates | |
parent | 9ead801a9cc8a98e44cde96ed860da8db99576e6 (diff) |
simplify
Diffstat (limited to 'crates')
-rw-r--r-- | crates/ra_hir/src/source_binder.rs | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/crates/ra_hir/src/source_binder.rs b/crates/ra_hir/src/source_binder.rs index bb638bcb6..880596615 100644 --- a/crates/ra_hir/src/source_binder.rs +++ b/crates/ra_hir/src/source_binder.rs | |||
@@ -96,15 +96,9 @@ fn function_from_source( | |||
96 | fn_def: &ast::FnDef, | 96 | fn_def: &ast::FnDef, |
97 | ) -> Option<Function> { | 97 | ) -> Option<Function> { |
98 | let module = module_from_child_node(db, file_id, fn_def.syntax())?; | 98 | let module = module_from_child_node(db, file_id, fn_def.syntax())?; |
99 | let res = function_from_module(db, module, fn_def); | ||
100 | Some(res) | ||
101 | } | ||
102 | |||
103 | fn function_from_module(db: &impl HirDatabase, module: Module, fn_def: &ast::FnDef) -> Function { | ||
104 | let (file_id, _) = module.definition_source(db); | ||
105 | let file_id = file_id.into(); | 99 | let file_id = file_id.into(); |
106 | let ctx = LocationCtx::new(db, module, file_id); | 100 | let ctx = LocationCtx::new(db, module, file_id); |
107 | Function { id: ctx.to_def(fn_def) } | 101 | Some(Function { id: ctx.to_def(fn_def) }) |
108 | } | 102 | } |
109 | 103 | ||
110 | fn function_from_child_node( | 104 | fn function_from_child_node( |