Make graph::DepthFirstSearch accept G by value

It's required for the next commit.

Note that you can still have `G = &H`, since there are implementations of all
the graph traits for references.
This commit is contained in:
Maybe Waffle
2024-04-15 18:17:51 +00:00
parent 86a576528c
commit 7d2cb3dda7
2 changed files with 13 additions and 13 deletions

View File

@@ -46,9 +46,9 @@ where
.is_some()
}
pub fn depth_first_search<G>(graph: &G, from: G::Node) -> iterate::DepthFirstSearch<'_, G>
pub fn depth_first_search<G>(graph: G, from: G::Node) -> iterate::DepthFirstSearch<G>
where
G: ?Sized + Successors,
G: Successors,
{
iterate::DepthFirstSearch::new(graph).with_start_node(from)
}