From 0320ebdd101b01abe5f24e9efcef7c15005fd3a5 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Mon, 9 Mar 2020 11:11:59 +0100 Subject: Use `Index` for CrateGraph --- crates/ra_ide/src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'crates/ra_ide/src/lib.rs') diff --git a/crates/ra_ide/src/lib.rs b/crates/ra_ide/src/lib.rs index 903624381..c60e86aea 100644 --- a/crates/ra_ide/src/lib.rs +++ b/crates/ra_ide/src/lib.rs @@ -421,12 +421,12 @@ impl Analysis { /// Returns the edition of the given crate. pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable { - 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 { - 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. -- cgit v1.2.3