From 01bd1e1296d31dbb102d198e9fd82e1e36f1193b Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Tue, 19 May 2020 16:46:33 +0200 Subject: Move public API to the top --- crates/ra_hir_def/src/find_path.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/crates/ra_hir_def/src/find_path.rs b/crates/ra_hir_def/src/find_path.rs index aee7e7511..15bc04c1a 100644 --- a/crates/ra_hir_def/src/find_path.rs +++ b/crates/ra_hir_def/src/find_path.rs @@ -13,6 +13,15 @@ use crate::{ CrateId, ModuleDefId, ModuleId, }; +// FIXME: handle local items + +/// Find a path that can be used to refer to a certain item. This can depend on +/// *from where* you're referring to the item, hence the `from` parameter. +pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option { + let _p = ra_prof::profile("find_path"); + find_path_inner(db, item, from, MAX_PATH_LEN) +} + const MAX_PATH_LEN: usize = 15; impl ModPath { @@ -39,15 +48,6 @@ impl ModPath { } } -// FIXME: handle local items - -/// Find a path that can be used to refer to a certain item. This can depend on -/// *from where* you're referring to the item, hence the `from` parameter. -pub fn find_path(db: &dyn DefDatabase, item: ItemInNs, from: ModuleId) -> Option { - let _p = ra_prof::profile("find_path"); - find_path_inner(db, item, from, MAX_PATH_LEN) -} - fn find_path_inner( db: &dyn DefDatabase, item: ItemInNs, -- cgit v1.2.3