From 65b00736535255c089cfef58c7b4eb13d4d8dbad Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Sat, 13 Apr 2019 09:33:34 +0300 Subject: simplify --- crates/ra_hir/src/source_binder.rs | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'crates/ra_hir') 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( fn_def: &ast::FnDef, ) -> Option { let module = module_from_child_node(db, file_id, fn_def.syntax())?; - let res = function_from_module(db, module, fn_def); - Some(res) -} - -fn function_from_module(db: &impl HirDatabase, module: Module, fn_def: &ast::FnDef) -> Function { - let (file_id, _) = module.definition_source(db); let file_id = file_id.into(); let ctx = LocationCtx::new(db, module, file_id); - Function { id: ctx.to_def(fn_def) } + Some(Function { id: ctx.to_def(fn_def) }) } fn function_from_child_node( -- cgit v1.2.3