From 54d053c881514b024ba399ce2edc678e3f710ab7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 4 Dec 2018 23:52:14 +0300 Subject: minor --- crates/ra_hir/src/function/mod.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'crates/ra_hir/src/function/mod.rs') diff --git a/crates/ra_hir/src/function/mod.rs b/crates/ra_hir/src/function/mod.rs index a6757601e..e00bca6e3 100644 --- a/crates/ra_hir/src/function/mod.rs +++ b/crates/ra_hir/src/function/mod.rs @@ -27,6 +27,11 @@ pub struct Function { } impl Function { + pub(crate) fn new(def_id: DefId) -> Function { + let fn_id = FnId(def_id); + Function { fn_id } + } + pub fn guess_from_source( db: &impl HirDatabase, file_id: FileId, @@ -42,8 +47,7 @@ impl Function { module_id: module.module_id, source_item_id, }; - let fn_id = FnId(def_loc.id(db)); - Ok(Some(Function { fn_id })) + Ok(Some(Function::new(def_loc.id(db)))) } pub fn guess_for_name_ref( -- cgit v1.2.3