mirror of
https://github.com/rust-lang/rust.git
synced 2024-12-11 08:05:12 +00:00
Move private API down
This commit is contained in:
parent
1b19a8aa5e
commit
c7b2bc1363
@ -16,21 +16,6 @@ use crate::{
|
||||
goto_definition, references, FilePosition, NavigationTarget, RangeInfo,
|
||||
};
|
||||
|
||||
#[derive(Default)]
|
||||
struct CallLocations {
|
||||
funcs: IndexMap<NavigationTarget, Vec<TextRange>>,
|
||||
}
|
||||
|
||||
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<CallItem> {
|
||||
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<NavigationTarget, Vec<TextRange>>,
|
||||
}
|
||||
|
||||
impl CallLocations {
|
||||
fn add(&mut self, target: &NavigationTarget, range: TextRange) {
|
||||
self.funcs.entry(target.clone()).or_default().push(range);
|
||||
}
|
||||
|
||||
fn into_items(self) -> Vec<CallItem> {
|
||||
self.funcs.into_iter().map(|(target, ranges)| CallItem { target, ranges }).collect()
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use ra_db::FilePosition;
|
||||
|
Loading…
Reference in New Issue
Block a user