Less abstract CrateData api

This commit is contained in:
Kirill Bulatov 2020-03-09 11:26:46 +02:00
parent 5cffef56e2
commit e1aa96f2c5
9 changed files with 48 additions and 51 deletions

View file

@ -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.