diff options
Diffstat (limited to 'crates/ra_db/src')
-rw-r--r-- | crates/ra_db/src/input.rs | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/crates/ra_db/src/input.rs b/crates/ra_db/src/input.rs index 405634fe0..8decc65c5 100644 --- a/crates/ra_db/src/input.rs +++ b/crates/ra_db/src/input.rs | |||
@@ -112,6 +112,7 @@ impl CrateGraph { | |||
112 | self.arena[&crate_id].file_id | 112 | self.arena[&crate_id].file_id |
113 | } | 113 | } |
114 | 114 | ||
115 | // TODO: this only finds one crate with the given root; we could have multiple | ||
115 | pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> { | 116 | pub fn crate_id_for_crate_root(&self, file_id: FileId) -> Option<CrateId> { |
116 | let (&crate_id, _) = self.arena.iter().find(|(_crate_id, data)| data.file_id == file_id)?; | 117 | let (&crate_id, _) = self.arena.iter().find(|(_crate_id, data)| data.file_id == file_id)?; |
117 | Some(crate_id) | 118 | Some(crate_id) |