From e8d2221e3bbb4e8971c97395463036ebd6e7b23d Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Sun, 14 Apr 2024 16:03:08 +0000 Subject: Make `depth_first_search` into a standalone function Does not necessarily change much, but we never overwrite it, so I see no reason for it to be in the `Successors` trait. (+we already have a similar `is_cyclic`) --- compiler/rustc_data_structures/src/graph/vec_graph/tests.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'compiler/rustc_data_structures/src/graph/vec_graph') diff --git a/compiler/rustc_data_structures/src/graph/vec_graph/tests.rs b/compiler/rustc_data_structures/src/graph/vec_graph/tests.rs index 7c866da6009..87c8d25f094 100644 --- a/compiler/rustc_data_structures/src/graph/vec_graph/tests.rs +++ b/compiler/rustc_data_structures/src/graph/vec_graph/tests.rs @@ -1,3 +1,5 @@ +use crate::graph; + use super::*; fn create_graph() -> VecGraph { @@ -37,6 +39,6 @@ fn successors() { #[test] fn dfs() { let graph = create_graph(); - let dfs: Vec<_> = graph.depth_first_search(0).collect(); + let dfs: Vec<_> = graph::depth_first_search(&graph, 0).collect(); assert_eq!(dfs, vec![0, 1, 3, 4, 2]); } -- cgit 1.4.1-3-g733a5