aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src/function
diff options
context:
space:
mode:
authorAleksey Kladov <[email protected]>2018-12-04 20:52:14 +0000
committerAleksey Kladov <[email protected]>2018-12-04 20:52:14 +0000
commit54d053c881514b024ba399ce2edc678e3f710ab7 (patch)
treebe2864c8f1906f096e37e0778fa18524e2ddbe67 /crates/ra_hir/src/function
parentd8b0379e1063941331253905795699a918233ef9 (diff)
minor
Diffstat (limited to 'crates/ra_hir/src/function')
-rw-r--r--crates/ra_hir/src/function/mod.rs8
1 files changed, 6 insertions, 2 deletions
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 {
27} 27}
28 28
29impl Function { 29impl Function {
30 pub(crate) fn new(def_id: DefId) -> Function {
31 let fn_id = FnId(def_id);
32 Function { fn_id }
33 }
34
30 pub fn guess_from_source( 35 pub fn guess_from_source(
31 db: &impl HirDatabase, 36 db: &impl HirDatabase,
32 file_id: FileId, 37 file_id: FileId,
@@ -42,8 +47,7 @@ impl Function {
42 module_id: module.module_id, 47 module_id: module.module_id,
43 source_item_id, 48 source_item_id,
44 }; 49 };
45 let fn_id = FnId(def_loc.id(db)); 50 Ok(Some(Function::new(def_loc.id(db))))
46 Ok(Some(Function { fn_id }))
47 } 51 }
48 52
49 pub fn guess_for_name_ref( 53 pub fn guess_for_name_ref(