Skip to content

Commit 81432a0

Browse files
committed
Fix clippy warnings
1 parent 3643e41 commit 81432a0

File tree

5 files changed

+31
-15
lines changed

5 files changed

+31
-15
lines changed

crates/builder/src/compat.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,13 +144,13 @@ mod tests {
144144
}
145145
}
146146

147-
impl<'a> PartialEq for Foo<'a> {
147+
impl PartialEq for Foo<'_> {
148148
fn eq(&self, other: &Self) -> bool {
149149
self.i.eq(&other.i)
150150
}
151151
}
152152

153-
impl<'a> Drop for Foo<'a> {
153+
impl Drop for Foo<'_> {
154154
fn drop(&mut self) {
155155
self.c.fetch_add(1, atomic::Ordering::SeqCst);
156156
}

crates/builder/src/graph/csr.rs

Lines changed: 23 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,7 @@ struct ToUndirectedEdges<'g, NI: Idx, NV, EV> {
409409
g: &'g DirectedCsrGraph<NI, NV, EV>,
410410
}
411411

412-
impl<'g, NI, NV, EV> Edges for ToUndirectedEdges<'g, NI, NV, EV>
412+
impl<NI, NV, EV> Edges for ToUndirectedEdges<'_, NI, NV, EV>
413413
where
414414
NI: Idx,
415415
NV: Send + Sync,
@@ -419,7 +419,8 @@ where
419419

420420
type EV = EV;
421421

422-
type EdgeIter<'a> = ToUndirectedEdgesIter<'a, NI, NV, EV>
422+
type EdgeIter<'a>
423+
= ToUndirectedEdgesIter<'a, NI, NV, EV>
423424
where
424425
Self: 'a;
425426

@@ -441,8 +442,8 @@ struct ToUndirectedEdgesIter<'g, NI: Idx, NV, EV> {
441442
g: &'g DirectedCsrGraph<NI, NV, EV>,
442443
}
443444

444-
impl<'g, NI: Idx, NV: Send + Sync, EV: Copy + Send + Sync> ParallelIterator
445-
for ToUndirectedEdgesIter<'g, NI, NV, EV>
445+
impl<NI: Idx, NV: Send + Sync, EV: Copy + Send + Sync> ParallelIterator
446+
for ToUndirectedEdgesIter<'_, NI, NV, EV>
446447
{
447448
type Item = (NI, NI, EV);
448449

@@ -488,7 +489,10 @@ impl<NI: Idx, NV, EV> DirectedDegrees<NI> for DirectedCsrGraph<NI, NV, EV> {
488489
}
489490

490491
impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedCsrGraph<NI, NV, ()> {
491-
type NeighborsIterator<'a> = std::slice::Iter<'a, NI> where NV: 'a;
492+
type NeighborsIterator<'a>
493+
= std::slice::Iter<'a, NI>
494+
where
495+
NV: 'a;
492496

493497
fn out_neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> {
494498
self.csr_out.targets(node).iter()
@@ -500,7 +504,11 @@ impl<NI: Idx, NV> DirectedNeighbors<NI> for DirectedCsrGraph<NI, NV, ()> {
500504
}
501505

502506
impl<NI: Idx, NV, EV> DirectedNeighborsWithValues<NI, EV> for DirectedCsrGraph<NI, NV, EV> {
503-
type NeighborsIterator<'a> = std::slice::Iter<'a, Target<NI, EV>> where NV:'a, EV: 'a;
507+
type NeighborsIterator<'a>
508+
= std::slice::Iter<'a, Target<NI, EV>>
509+
where
510+
NV: 'a,
511+
EV: 'a;
504512

505513
fn out_neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> {
506514
self.csr_out.targets_with_values(node).iter()
@@ -694,15 +702,22 @@ impl<NI: Idx, NV, EV> UndirectedDegrees<NI> for UndirectedCsrGraph<NI, NV, EV> {
694702
}
695703

696704
impl<NI: Idx, NV> UndirectedNeighbors<NI> for UndirectedCsrGraph<NI, NV> {
697-
type NeighborsIterator<'a> = std::slice::Iter<'a, NI> where NV: 'a;
705+
type NeighborsIterator<'a>
706+
= std::slice::Iter<'a, NI>
707+
where
708+
NV: 'a;
698709

699710
fn neighbors(&self, node: NI) -> Self::NeighborsIterator<'_> {
700711
self.csr.targets(node).iter()
701712
}
702713
}
703714

704715
impl<NI: Idx, NV, EV> UndirectedNeighborsWithValues<NI, EV> for UndirectedCsrGraph<NI, NV, EV> {
705-
type NeighborsIterator<'a> = std::slice::Iter<'a, Target<NI, EV>> where NV: 'a, EV: 'a;
716+
type NeighborsIterator<'a>
717+
= std::slice::Iter<'a, Target<NI, EV>>
718+
where
719+
NV: 'a,
720+
EV: 'a;
706721

707722
fn neighbors_with_values(&self, node: NI) -> Self::NeighborsIterator<'_> {
708723
self.csr.targets_with_values(node).iter()

crates/builder/src/graph_ops.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ pub trait ToUndirectedOp {
204204
///
205205
/// This method accepts an optional [`CsrLayout`] as second parameter,
206206
/// which has the same effect as described in [`GraphBuilder::csr_layout`]
207-
207+
///
208208
/// # Example
209209
///
210210
/// ```

crates/builder/src/input/gdl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ use std::hash::Hash;
1616
/// A wrapper around [`gdl::CypherValue`] to allow custom From implementations.
1717
pub struct MyCypherValue<'a>(&'a CypherValue);
1818

19-
impl<'a> From<MyCypherValue<'a>> for () {
19+
impl From<MyCypherValue<'_>> for () {
2020
fn from(_: MyCypherValue) -> Self {}
2121
}
2222

crates/mate/src/graphs/mod.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -450,7 +450,7 @@ impl<'a, T> ArrayEdgeList<'a, T> {
450450

451451
struct ArrayRows<'a, T>(AxisIter<'a, T, Ix1>);
452452

453-
impl<'a, T: Copy + Debug> Iterator for ArrayRows<'a, T> {
453+
impl<T: Copy + Debug> Iterator for ArrayRows<'_, T> {
454454
type Item = (T, T, ());
455455

456456
fn next(&mut self) -> Option<Self::Item> {
@@ -459,12 +459,13 @@ impl<'a, T: Copy + Debug> Iterator for ArrayRows<'a, T> {
459459
}
460460
}
461461

462-
impl<'outer, T: Idx> Edges for ArrayEdgeList<'outer, T> {
462+
impl<T: Idx> Edges for ArrayEdgeList<'_, T> {
463463
type NI = T;
464464

465465
type EV = ();
466466

467-
type EdgeIter<'a> = rayon::iter::IterBridge<ArrayRows<'a, T>>
467+
type EdgeIter<'a>
468+
= rayon::iter::IterBridge<ArrayRows<'a, T>>
468469
where
469470
Self: 'a;
470471

0 commit comments

Comments
 (0)