Remove needless lifetimes
This commit is contained in:
parent
0477e07272
commit
6ae80cf23f
19 changed files with 59 additions and 59 deletions
|
|
@ -26,10 +26,10 @@ pub trait WithSuccessors: DirectedGraph
|
|||
where
|
||||
Self: for<'graph> GraphSuccessors<'graph, Item = <Self as DirectedGraph>::Node>,
|
||||
{
|
||||
fn successors<'graph>(
|
||||
&'graph self,
|
||||
fn successors(
|
||||
&self,
|
||||
node: Self::Node,
|
||||
) -> <Self as GraphSuccessors<'graph>>::Iter;
|
||||
) -> <Self as GraphSuccessors<'_>>::Iter;
|
||||
|
||||
fn depth_first_search(&self, from: Self::Node) -> iterate::DepthFirstSearch<'_, Self>
|
||||
where
|
||||
|
|
@ -48,10 +48,10 @@ pub trait WithPredecessors: DirectedGraph
|
|||
where
|
||||
Self: for<'graph> GraphPredecessors<'graph, Item = <Self as DirectedGraph>::Node>,
|
||||
{
|
||||
fn predecessors<'graph>(
|
||||
&'graph self,
|
||||
fn predecessors(
|
||||
&self,
|
||||
node: Self::Node,
|
||||
) -> <Self as GraphPredecessors<'graph>>::Iter;
|
||||
) -> <Self as GraphPredecessors<'_>>::Iter;
|
||||
}
|
||||
|
||||
pub trait GraphPredecessors<'graph> {
|
||||
|
|
|
|||
|
|
@ -17,15 +17,15 @@ impl<'graph, G: WithStartNode> WithStartNode for &'graph G {
|
|||
}
|
||||
|
||||
impl<'graph, G: WithSuccessors> WithSuccessors for &'graph G {
|
||||
fn successors<'iter>(&'iter self, node: Self::Node) -> <Self as GraphSuccessors<'iter>>::Iter {
|
||||
fn successors(&self, node: Self::Node) -> <Self as GraphSuccessors<'_>>::Iter {
|
||||
(**self).successors(node)
|
||||
}
|
||||
}
|
||||
|
||||
impl<'graph, G: WithPredecessors> WithPredecessors for &'graph G {
|
||||
fn predecessors<'iter>(&'iter self,
|
||||
node: Self::Node)
|
||||
-> <Self as GraphPredecessors<'iter>>::Iter {
|
||||
fn predecessors(&self,
|
||||
node: Self::Node)
|
||||
-> <Self as GraphPredecessors<'_>>::Iter {
|
||||
(**self).predecessors(node)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,15 +51,15 @@ impl WithNumNodes for TestGraph {
|
|||
}
|
||||
|
||||
impl WithPredecessors for TestGraph {
|
||||
fn predecessors<'graph>(&'graph self,
|
||||
node: usize)
|
||||
-> <Self as GraphPredecessors<'graph>>::Iter {
|
||||
fn predecessors(&self,
|
||||
node: usize)
|
||||
-> <Self as GraphPredecessors<'_>>::Iter {
|
||||
self.predecessors[&node].iter().cloned()
|
||||
}
|
||||
}
|
||||
|
||||
impl WithSuccessors for TestGraph {
|
||||
fn successors<'graph>(&'graph self, node: usize) -> <Self as GraphSuccessors<'graph>>::Iter {
|
||||
fn successors(&self, node: usize) -> <Self as GraphSuccessors>::Iter {
|
||||
self.successors[&node].iter().cloned()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue