mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-01 14:21:44 +00:00
Less abstract CrateData api
This commit is contained in:
parent
5cffef56e2
commit
e1aa96f2c5
9 changed files with 48 additions and 51 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().edition(crate_id))
|
||||
self.with_db(|db| db.crate_graph().crate_data(&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_root(crate_id))
|
||||
self.with_db(|db| db.crate_graph().crate_data(&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