diff options
Diffstat (limited to 'crates/base_db')
-rw-r--r-- | crates/base_db/src/input.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/base_db/src/input.rs b/crates/base_db/src/input.rs index e9e8dfc2e..248ab1de2 100644 --- a/crates/base_db/src/input.rs +++ b/crates/base_db/src/input.rs | |||
@@ -274,13 +274,15 @@ impl CrateGraph { | |||
274 | deps.into_iter() | 274 | deps.into_iter() |
275 | } | 275 | } |
276 | 276 | ||
277 | /// Returns an iterator over all transitive reverse dependencies of the given crate. | 277 | /// Returns all transitive reverse dependencies of the given crate, |
278 | /// including the crate itself. | ||
278 | pub fn transitive_reverse_dependencies( | 279 | pub fn transitive_reverse_dependencies( |
279 | &self, | 280 | &self, |
280 | of: CrateId, | 281 | of: CrateId, |
281 | ) -> impl Iterator<Item = CrateId> + '_ { | 282 | ) -> impl Iterator<Item = CrateId> + '_ { |
282 | let mut worklist = vec![of]; | 283 | let mut worklist = vec![of]; |
283 | let mut rev_deps = FxHashSet::default(); | 284 | let mut rev_deps = FxHashSet::default(); |
285 | rev_deps.insert(of); | ||
284 | let mut inverted_graph = FxHashMap::<_, Vec<_>>::default(); | 286 | let mut inverted_graph = FxHashMap::<_, Vec<_>>::default(); |
285 | self.arena.iter().for_each(|(&krate, data)| { | 287 | self.arena.iter().for_each(|(&krate, data)| { |
286 | data.dependencies | 288 | data.dependencies |