diff options
Diffstat (limited to 'crates/ra_hir_ty/src/test_db.rs')
-rw-r--r-- | crates/ra_hir_ty/src/test_db.rs | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/crates/ra_hir_ty/src/test_db.rs b/crates/ra_hir_ty/src/test_db.rs index 1a31b587b..c794f7b84 100644 --- a/crates/ra_hir_ty/src/test_db.rs +++ b/crates/ra_hir_ty/src/test_db.rs | |||
@@ -86,15 +86,14 @@ impl TestDB { | |||
86 | pub fn diagnostics(&self) -> String { | 86 | pub fn diagnostics(&self) -> String { |
87 | let mut buf = String::new(); | 87 | let mut buf = String::new(); |
88 | let crate_graph = self.crate_graph(); | 88 | let crate_graph = self.crate_graph(); |
89 | for krate in crate_graph.iter().next() { | 89 | for krate in crate_graph.iter() { |
90 | let crate_def_map = self.crate_def_map(krate); | 90 | let crate_def_map = self.crate_def_map(krate); |
91 | 91 | ||
92 | let mut fns = Vec::new(); | 92 | let mut fns = Vec::new(); |
93 | for (module_id, _) in crate_def_map.modules.iter() { | 93 | for (module_id, _) in crate_def_map.modules.iter() { |
94 | for decl in crate_def_map[module_id].scope.declarations() { | 94 | for decl in crate_def_map[module_id].scope.declarations() { |
95 | match decl { | 95 | if let ModuleDefId::FunctionId(f) = decl { |
96 | ModuleDefId::FunctionId(f) => fns.push(f), | 96 | fns.push(f) |
97 | _ => (), | ||
98 | } | 97 | } |
99 | } | 98 | } |
100 | 99 | ||