Use RPITIT for Successors and Predecessors traits

Now with RPITIT instead of GAT!
This commit is contained in:
Maybe Waffle
2024-04-15 13:33:08 +00:00
parent e8d2221e3b
commit 435db9b9bd
8 changed files with 14 additions and 46 deletions

View File

@@ -93,9 +93,7 @@ impl<N: Idx> NumEdges for VecGraph<N> {
}
impl<N: Idx + Ord> Successors for VecGraph<N> {
type Successors<'g> = std::iter::Cloned<std::slice::Iter<'g, N>>;
fn successors(&self, node: N) -> Self::Successors<'_> {
fn successors(&self, node: N) -> impl Iterator<Item = Self::Node> {
self.successors(node).iter().cloned()
}
}