From c7b2bc1363c8422122a0d1fbd5ff68b5984cf173 Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 8 Jan 2020 11:33:04 -0500 Subject: Move private API down --- crates/ra_ide/src/call_hierarchy.rs | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/crates/ra_ide/src/call_hierarchy.rs b/crates/ra_ide/src/call_hierarchy.rs index 75658c20b..1cb712e32 100644 --- a/crates/ra_ide/src/call_hierarchy.rs +++ b/crates/ra_ide/src/call_hierarchy.rs @@ -16,21 +16,6 @@ use crate::{ goto_definition, references, FilePosition, NavigationTarget, RangeInfo, }; -#[derive(Default)] -struct CallLocations { - funcs: IndexMap>, -} - -impl CallLocations { - pub fn add(&mut self, target: &NavigationTarget, range: TextRange) { - self.funcs.entry(target.clone()).or_default().push(range); - } - - pub fn into_items(self) -> Vec { - self.funcs.into_iter().map(|(target, ranges)| CallItem { target, ranges }).collect() - } -} - #[derive(Debug, Clone)] pub struct CallItem { pub target: NavigationTarget, @@ -146,6 +131,21 @@ pub(crate) fn outgoing_calls(db: &RootDatabase, position: FilePosition) -> Optio Some(calls.into_items()) } +#[derive(Default)] +struct CallLocations { + funcs: IndexMap>, +} + +impl CallLocations { + fn add(&mut self, target: &NavigationTarget, range: TextRange) { + self.funcs.entry(target.clone()).or_default().push(range); + } + + fn into_items(self) -> Vec { + self.funcs.into_iter().map(|(target, ranges)| CallItem { target, ranges }).collect() + } +} + #[cfg(test)] mod tests { use ra_db::FilePosition; -- cgit v1.2.3