diff --git a/crates/builder/src/compat.rs b/crates/builder/src/compat.rs index cee9701..eaa717c 100644 --- a/crates/builder/src/compat.rs +++ b/crates/builder/src/compat.rs @@ -144,13 +144,13 @@ mod tests { } } - impl<'a> PartialEq for Foo<'a> { + impl PartialEq for Foo<'_> { fn eq(&self, other: &Self) -> bool { self.i.eq(&other.i) } } - impl<'a> Drop for Foo<'a> { + impl Drop for Foo<'_> { fn drop(&mut self) { self.c.fetch_add(1, atomic::Ordering::SeqCst); } diff --git a/crates/builder/src/graph/adj_list.rs b/crates/builder/src/graph/adj_list.rs index 5e77c58..b3dacd8 100644 --- a/crates/builder/src/graph/adj_list.rs +++ b/crates/builder/src/graph/adj_list.rs @@ -338,7 +338,10 @@ impl DirectedDegrees for DirectedALGraph { } impl DirectedNeighbors for DirectedALGraph { - type NeighborsIterator<'a> = TargetsIter<'a, NI> where NV: 'a; + type NeighborsIterator<'a> + = TargetsIter<'a, NI> + where + NV: 'a; fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> { self.al_out.targets(node).into_iter() @@ -350,7 +353,11 @@ impl DirectedNeighbors for DirectedALGraph { } impl DirectedNeighborsWithValues for DirectedALGraph { - type NeighborsIterator<'a> = TargetsWithValuesIter<'a, NI, EV> where NV: 'a, EV: 'a; + type NeighborsIterator<'a> + = TargetsWithValuesIter<'a, NI, EV> + where + NV: 'a, + EV: 'a; fn out_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> { self.al_out.targets_with_values(node).into_iter() @@ -492,7 +499,10 @@ impl UndirectedDegrees for UndirectedALGraph { } impl UndirectedNeighbors for UndirectedALGraph { - type NeighborsIterator<'a> = TargetsIter<'a, NI> where NV: 'a; + type NeighborsIterator<'a> + = TargetsIter<'a, NI> + where + NV: 'a; fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> { self.al.targets(node).into_iter() @@ -500,7 +510,11 @@ impl UndirectedNeighbors for UndirectedALGraph { } impl UndirectedNeighborsWithValues for UndirectedALGraph { - type NeighborsIterator<'a> = TargetsWithValuesIter<'a, NI, EV> where NV: 'a, EV: 'a; + type NeighborsIterator<'a> + = TargetsWithValuesIter<'a, NI, EV> + where + NV: 'a, + EV: 'a; fn neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> { self.al.targets_with_values(node).into_iter() diff --git a/crates/builder/src/graph/csr.rs b/crates/builder/src/graph/csr.rs index 346cb25..bdf6407 100644 --- a/crates/builder/src/graph/csr.rs +++ b/crates/builder/src/graph/csr.rs @@ -409,7 +409,7 @@ struct ToUndirectedEdges<'g, NI: Idx, NV, EV> { g: &'g DirectedCsrGraph, } -impl<'g, NI, NV, EV> Edges for ToUndirectedEdges<'g, NI, NV, EV> +impl Edges for ToUndirectedEdges<'_, NI, NV, EV> where NI: Idx, NV: Send + Sync, @@ -419,7 +419,8 @@ where type EV = EV; - type EdgeIter<'a> = ToUndirectedEdgesIter<'a, NI, NV, EV> + type EdgeIter<'a> + = ToUndirectedEdgesIter<'a, NI, NV, EV> where Self: 'a; @@ -441,8 +442,8 @@ struct ToUndirectedEdgesIter<'g, NI: Idx, NV, EV> { g: &'g DirectedCsrGraph, } -impl<'g, NI: Idx, NV: Send + Sync, EV: Copy + Send + Sync> ParallelIterator - for ToUndirectedEdgesIter<'g, NI, NV, EV> +impl ParallelIterator + for ToUndirectedEdgesIter<'_, NI, NV, EV> { type Item = (NI, NI, EV); @@ -488,7 +489,10 @@ impl DirectedDegrees for DirectedCsrGraph { } impl DirectedNeighbors for DirectedCsrGraph { - type NeighborsIterator<'a> = std::slice::Iter<'a, NI> where NV: 'a; + type NeighborsIterator<'a> + = std::slice::Iter<'a, NI> + where + NV: 'a; fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> { self.csr_out.targets(node).iter() @@ -500,7 +504,11 @@ impl DirectedNeighbors for DirectedCsrGraph { } impl DirectedNeighborsWithValues for DirectedCsrGraph { - type NeighborsIterator<'a> = std::slice::Iter<'a, Target> where NV:'a, EV: 'a; + type NeighborsIterator<'a> + = std::slice::Iter<'a, Target> + where + NV: 'a, + EV: 'a; fn out_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> { self.csr_out.targets_with_values(node).iter() @@ -694,7 +702,10 @@ impl UndirectedDegrees for UndirectedCsrGraph { } impl UndirectedNeighbors for UndirectedCsrGraph { - type NeighborsIterator<'a> = std::slice::Iter<'a, NI> where NV: 'a; + type NeighborsIterator<'a> + = std::slice::Iter<'a, NI> + where + NV: 'a; fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> { self.csr.targets(node).iter() @@ -702,7 +713,11 @@ impl UndirectedNeighbors for UndirectedCsrGraph { } impl UndirectedNeighborsWithValues for UndirectedCsrGraph { - type NeighborsIterator<'a> = std::slice::Iter<'a, Target> where NV: 'a, EV: 'a; + type NeighborsIterator<'a> + = std::slice::Iter<'a, Target> + where + NV: 'a, + EV: 'a; fn neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> { self.csr.targets_with_values(node).iter() diff --git a/crates/builder/src/graph_ops.rs b/crates/builder/src/graph_ops.rs index 4a7d40a..16f534e 100644 --- a/crates/builder/src/graph_ops.rs +++ b/crates/builder/src/graph_ops.rs @@ -204,7 +204,7 @@ pub trait ToUndirectedOp { /// /// This method accepts an optional [`CsrLayout`] as second parameter, /// which has the same effect as described in [`GraphBuilder::csr_layout`] - + /// /// # Example /// /// ``` diff --git a/crates/builder/src/input/edgelist.rs b/crates/builder/src/input/edgelist.rs index e675db4..f14ea64 100644 --- a/crates/builder/src/input/edgelist.rs +++ b/crates/builder/src/input/edgelist.rs @@ -116,7 +116,8 @@ impl Edges for EdgeList { type EV = EV; - type EdgeIter<'a> = rayon::iter::Copied> + type EdgeIter<'a> + = rayon::iter::Copied> where Self: 'a; diff --git a/crates/builder/src/input/gdl.rs b/crates/builder/src/input/gdl.rs index 24743e3..7126307 100644 --- a/crates/builder/src/input/gdl.rs +++ b/crates/builder/src/input/gdl.rs @@ -16,7 +16,7 @@ use std::hash::Hash; /// A wrapper around [`gdl::CypherValue`] to allow custom From implementations. pub struct MyCypherValue<'a>(&'a CypherValue); -impl<'a> From> for () { +impl From> for () { fn from(_: MyCypherValue) -> Self {} } diff --git a/crates/builder/src/input/graph500.rs b/crates/builder/src/input/graph500.rs index f542e2e..62df764 100644 --- a/crates/builder/src/input/graph500.rs +++ b/crates/builder/src/input/graph500.rs @@ -27,9 +27,10 @@ impl Edges for Graph500 { type EV = (); - type EdgeIter<'a> = rayon::iter::Copied> - where - Self: 'a; + type EdgeIter<'a> + = rayon::iter::Copied> + where + Self: 'a; fn edges(&self) -> Self::EdgeIter<'_> { self.0.edges() diff --git a/crates/mate/src/graphs/mod.rs b/crates/mate/src/graphs/mod.rs index 5238cb5..2ed786e 100644 --- a/crates/mate/src/graphs/mod.rs +++ b/crates/mate/src/graphs/mod.rs @@ -450,7 +450,7 @@ impl<'a, T> ArrayEdgeList<'a, T> { struct ArrayRows<'a, T>(AxisIter<'a, T, Ix1>); -impl<'a, T: Copy + Debug> Iterator for ArrayRows<'a, T> { +impl Iterator for ArrayRows<'_, T> { type Item = (T, T, ()); fn next(&mut self) -> Option { @@ -459,12 +459,13 @@ impl<'a, T: Copy + Debug> Iterator for ArrayRows<'a, T> { } } -impl<'outer, T: Idx> Edges for ArrayEdgeList<'outer, T> { +impl Edges for ArrayEdgeList<'_, T> { type NI = T; type EV = (); - type EdgeIter<'a> = rayon::iter::IterBridge> + type EdgeIter<'a> + = rayon::iter::IterBridge> where Self: 'a;