diff options
author | Aleksey Kladov <[email protected]> | 2020-03-09 10:11:59 +0000 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2020-03-09 10:11:59 +0000 |
commit | 0320ebdd101b01abe5f24e9efcef7c15005fd3a5 (patch) | |
tree | 37d5176dfabe886b1eadb2ddb16fbb6834df0a16 /crates/ra_ide | |
parent | 57c27f91392fdd9d72fd023f4e2fecd8b68a7d09 (diff) |
Use `Index` for CrateGraph
Diffstat (limited to 'crates/ra_ide')
-rw-r--r-- | crates/ra_ide/src/hover.rs | 2 | ||||
-rw-r--r-- | crates/ra_ide/src/lib.rs | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/crates/ra_ide/src/hover.rs b/crates/ra_ide/src/hover.rs index 8b8af35fc..25e038a55 100644 --- a/crates/ra_ide/src/hover.rs +++ b/crates/ra_ide/src/hover.rs | |||
@@ -121,7 +121,7 @@ fn definition_owner_name(db: &RootDatabase, def: &Definition) -> Option<String> | |||
121 | 121 | ||
122 | fn determine_mod_path(db: &RootDatabase, def: &Definition) -> Option<String> { | 122 | fn determine_mod_path(db: &RootDatabase, def: &Definition) -> Option<String> { |
123 | let mod_path = def.module(db).map(|module| { | 123 | let mod_path = def.module(db).map(|module| { |
124 | once(db.crate_graph().crate_data(&module.krate().into()).display_name.clone()) | 124 | once(db.crate_graph()[module.krate().into()].display_name.clone()) |
125 | .chain( | 125 | .chain( |
126 | module | 126 | module |
127 | .path_to_root(db) | 127 | .path_to_root(db) |
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 { | |||
421 | 421 | ||
422 | /// Returns the edition of the given crate. | 422 | /// Returns the edition of the given crate. |
423 | pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable<Edition> { | 423 | pub fn crate_edition(&self, crate_id: CrateId) -> Cancelable<Edition> { |
424 | self.with_db(|db| db.crate_graph().crate_data(&crate_id).edition) | 424 | self.with_db(|db| db.crate_graph()[crate_id].edition) |
425 | } | 425 | } |
426 | 426 | ||
427 | /// Returns the root file of the given crate. | 427 | /// Returns the root file of the given crate. |
428 | pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> { | 428 | pub fn crate_root(&self, crate_id: CrateId) -> Cancelable<FileId> { |
429 | self.with_db(|db| db.crate_graph().crate_data(&crate_id).root_file_id) | 429 | self.with_db(|db| db.crate_graph()[crate_id].root_file_id) |
430 | } | 430 | } |
431 | 431 | ||
432 | /// Returns the set of possible targets to run for the current file. | 432 | /// Returns the set of possible targets to run for the current file. |