mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
use module_for_source
This commit is contained in:
parent
cd878658d3
commit
88a15d10d5
3 changed files with 8 additions and 12 deletions
|
@ -34,12 +34,8 @@ impl ModuleTree {
|
|||
.collect()
|
||||
}
|
||||
|
||||
pub(crate) fn modules_for_file(&self, file_id: FileId) -> Vec<ModuleId> {
|
||||
self.modules_for_source(ModuleSource::File(file_id))
|
||||
}
|
||||
|
||||
pub(crate) fn any_module_for_file(&self, file_id: FileId) -> Option<ModuleId> {
|
||||
self.modules_for_file(file_id).pop()
|
||||
pub(crate) fn any_module_for_source(&self, source: ModuleSource) -> Option<ModuleId> {
|
||||
self.modules_for_source(source).pop()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue