mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 06:11:35 +00:00
Use Index
for CrateGraph
This commit is contained in:
parent
57c27f9139
commit
0320ebdd10
9 changed files with 24 additions and 23 deletions
|
@ -421,12 +421,12 @@ impl Analysis {
|
|||
|
||||
/// Returns the edition of the given crate.
|
||||
pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable<Edition> {
|
||||
self.with_db(|db| db.crate_graph().crate_data(&crate_id).edition)
|
||||
self.with_db(|db| db.crate_graph()[crate_id].edition)
|
||||
}
|
||||
|
||||
/// Returns the root file of the given crate.
|
||||
pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> {
|
||||
self.with_db(|db| db.crate_graph().crate_data(&crate_id).root_file_id)
|
||||
self.with_db(|db| db.crate_graph()[crate_id].root_file_id)
|
||||
}
|
||||
|
||||
/// Returns the set of possible targets to run for the current file.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue