mirror of
https://github.com/rust-lang/rust-analyzer
synced 2024-12-26 04:53:34 +00:00
micro-optimize
This commit is contained in:
parent
294534abc7
commit
a668f703fa
1 changed files with 3 additions and 2 deletions
|
@ -113,13 +113,14 @@ impl AnalysisImpl {
|
||||||
|
|
||||||
}
|
}
|
||||||
pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> {
|
pub fn parent_module(&self, file_id: FileId) -> Vec<(FileId, FileSymbol)> {
|
||||||
let module_map = self.root(file_id).module_map();
|
let root = self.root(file_id);
|
||||||
|
let module_map = root.module_map();
|
||||||
let id = module_map.file2module(file_id);
|
let id = module_map.file2module(file_id);
|
||||||
module_map
|
module_map
|
||||||
.parent_modules(
|
.parent_modules(
|
||||||
id,
|
id,
|
||||||
&*self.file_resolver,
|
&*self.file_resolver,
|
||||||
&|file_id| self.file_syntax(file_id),
|
&|file_id| root.syntax(file_id),
|
||||||
)
|
)
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|(id, name, node)| {
|
.map(|(id, name, node)| {
|
||||||
|
|
Loading…
Reference in a new issue