Move public API to the top

This commit is contained in:
Aleksey Kladov 2020-05-19 16:46:33 +02:00
parent 908da9ac1b
commit 01bd1e1296

View file

@ -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<ModPath> {
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<ModPath> {
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,