diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-10-14 13:22:54 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2019-10-14 13:22:54 +0100 |
commit | 1f4fbc0035a6a9ee1b599a3aa9f236989633a9f7 (patch) | |
tree | 40ee641fc90ecf384199ac537542deb71689d30d /crates/ra_hir/src | |
parent | bc7de5d47a56b9f2ab44f833130ba6d77aefe864 (diff) | |
parent | 1555a1aa0d5d45e4b317db272c07ad3e8470553d (diff) |
Merge #2007
2007: remove one more dependency on source roots r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r-- | crates/ra_hir/src/code_model.rs | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crates/ra_hir/src/code_model.rs b/crates/ra_hir/src/code_model.rs index 8055a07db..8eb3c577d 100644 --- a/crates/ra_hir/src/code_model.rs +++ b/crates/ra_hir/src/code_model.rs | |||
@@ -5,7 +5,7 @@ pub(crate) mod docs; | |||
5 | 5 | ||
6 | use std::sync::Arc; | 6 | use std::sync::Arc; |
7 | 7 | ||
8 | use ra_db::{CrateId, Edition, FileId, SourceRootId}; | 8 | use ra_db::{CrateId, Edition, FileId}; |
9 | use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; | 9 | use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; |
10 | 10 | ||
11 | use crate::{ | 11 | use crate::{ |
@@ -76,10 +76,8 @@ impl Crate { | |||
76 | crate_graph.edition(self.crate_id) | 76 | crate_graph.edition(self.crate_id) |
77 | } | 77 | } |
78 | 78 | ||
79 | // FIXME: should this be in source_binder? | 79 | pub fn all(db: &impl DefDatabase) -> Vec<Crate> { |
80 | pub fn source_root_crates(db: &impl DefDatabase, source_root: SourceRootId) -> Vec<Crate> { | 80 | db.crate_graph().iter().map(|crate_id| Crate { crate_id }).collect() |
81 | let crate_ids = db.source_root_crates(source_root); | ||
82 | crate_ids.iter().map(|&crate_id| Crate { crate_id }).collect() | ||
83 | } | 81 | } |
84 | } | 82 | } |
85 | 83 | ||