aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir/src
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_hir/src')
-rw-r--r--crates/ra_hir/src/code_model.rs8
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
6use std::sync::Arc; 6use std::sync::Arc;
7 7
8use ra_db::{CrateId, Edition, FileId, SourceRootId}; 8use ra_db::{CrateId, Edition, FileId};
9use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner}; 9use ra_syntax::ast::{self, NameOwner, TypeAscriptionOwner};
10 10
11use crate::{ 11use 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