Skip to content

Commit

Permalink
fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
jswrenn committed Dec 23, 2024
1 parent f80883b commit ff0c942
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 17 deletions.
4 changes: 2 additions & 2 deletions src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -515,7 +515,7 @@ pub struct TakeWhileRef<'a, I: 'a, F> {
f: F,
}

impl<'a, I, F> fmt::Debug for TakeWhileRef<'a, I, F>
impl<I, F> fmt::Debug for TakeWhileRef<'_, I, F>
where
I: Iterator + fmt::Debug,
{
Expand All @@ -530,7 +530,7 @@ where
TakeWhileRef { iter, f }
}

impl<'a, I, F> Iterator for TakeWhileRef<'a, I, F>
impl<I, F> Iterator for TakeWhileRef<'_, I, F>
where
I: Iterator + Clone,
F: FnMut(&I::Item) -> bool,
Expand Down
14 changes: 7 additions & 7 deletions src/format.rs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ where
}
}

impl<'a, I, F> fmt::Display for FormatWith<'a, I, F>
impl<I, F> fmt::Display for FormatWith<'_, I, F>
where
I: Iterator,
F: FnMut(I::Item, &mut dyn FnMut(&dyn fmt::Display) -> fmt::Result) -> fmt::Result,
Expand All @@ -71,7 +71,7 @@ where
}
}

impl<'a, I, F> fmt::Debug for FormatWith<'a, I, F>
impl<I, F> fmt::Debug for FormatWith<'_, I, F>
where
I: Iterator,
F: FnMut(I::Item, &mut dyn FnMut(&dyn fmt::Display) -> fmt::Result) -> fmt::Result,
Expand All @@ -81,7 +81,7 @@ where
}
}

impl<'a, I> Format<'a, I>
impl<I> Format<'_, I>
where
I: Iterator,
{
Expand Down Expand Up @@ -125,7 +125,7 @@ macro_rules! impl_format {

impl_format! {Display Debug UpperExp LowerExp UpperHex LowerHex Octal Binary Pointer}

impl<'a, I, F> Clone for FormatWith<'a, I, F>
impl<I, F> Clone for FormatWith<'_, I, F>
where
(I, F): Clone,
{
Expand All @@ -135,7 +135,7 @@ where
inner: Option<(I, F)>,
}
// This ensures we preserve the state of the original `FormatWith` if `Clone` panics
impl<'r, 'a, I, F> Drop for PutBackOnDrop<'r, 'a, I, F> {
impl<I, F> Drop for PutBackOnDrop<'_, '_, I, F> {
fn drop(&mut self) {
self.into.inner.set(self.inner.take())
}
Expand All @@ -151,7 +151,7 @@ where
}
}

impl<'a, I> Clone for Format<'a, I>
impl<I> Clone for Format<'_, I>
where
I: Clone,
{
Expand All @@ -161,7 +161,7 @@ where
inner: Option<I>,
}
// This ensures we preserve the state of the original `FormatWith` if `Clone` panics
impl<'r, 'a, I> Drop for PutBackOnDrop<'r, 'a, I> {
impl<I> Drop for PutBackOnDrop<'_, '_, I> {
fn drop(&mut self) {
self.into.inner.set(self.inner.take())
}
Expand Down
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1055,7 +1055,6 @@ pub trait Itertools: Iterator {
/// let it = a.merge_by(b, |x, y| x.1 <= y.1);
/// itertools::assert_equal(it, vec![(0, 'a'), (0, 'b'), (1, 'c'), (1, 'd')]);
/// ```
fn merge_by<J, F>(self, other: J, is_first: F) -> MergeBy<Self, J::IntoIter, F>
where
Self: Sized,
Expand Down
6 changes: 3 additions & 3 deletions src/peeking_take_while.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ pub trait PeekingNext: Iterator {
F: FnOnce(&Self::Item) -> bool;
}

impl<'a, I> PeekingNext for &'a mut I
impl<I> PeekingNext for &mut I
where
I: PeekingNext,
{
Expand Down Expand Up @@ -133,7 +133,7 @@ where
PeekingTakeWhile { iter, f }
}

impl<'a, I, F> Iterator for PeekingTakeWhile<'a, I, F>
impl<I, F> Iterator for PeekingTakeWhile<'_, I, F>
where
I: PeekingNext,
F: FnMut(&I::Item) -> bool,
Expand All @@ -148,7 +148,7 @@ where
}
}

impl<'a, I, F> PeekingNext for PeekingTakeWhile<'a, I, F>
impl<I, F> PeekingNext for PeekingTakeWhile<'_, I, F>
where
I: PeekingNext,
F: FnMut(&I::Item) -> bool,
Expand Down
6 changes: 3 additions & 3 deletions src/process_results_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub struct ProcessResults<'a, I, E: 'a> {
iter: I,
}

impl<'a, I, E> ProcessResults<'a, I, E> {
impl<I, E> ProcessResults<'_, I, E> {
#[inline(always)]
fn next_body<T>(&mut self, item: Option<Result<T, E>>) -> Option<T> {
match item {
Expand All @@ -27,7 +27,7 @@ impl<'a, I, E> ProcessResults<'a, I, E> {
}
}

impl<'a, I, T, E> Iterator for ProcessResults<'a, I, E>
impl<I, T, E> Iterator for ProcessResults<'_, I, E>
where
I: Iterator<Item = Result<T, E>>,
{
Expand Down Expand Up @@ -60,7 +60,7 @@ where
}
}

impl<'a, I, T, E> DoubleEndedIterator for ProcessResults<'a, I, E>
impl<I, T, E> DoubleEndedIterator for ProcessResults<'_, I, E>
where
I: Iterator<Item = Result<T, E>>,
I: DoubleEndedIterator,
Expand Down
2 changes: 1 addition & 1 deletion src/rciter_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ where
}

/// Return an iterator from `&RcIter<I>` (by simply cloning it).
impl<'a, I> IntoIterator for &'a RcIter<I>
impl<I> IntoIterator for &RcIter<I>
where
I: Iterator,
{
Expand Down

0 comments on commit ff0c942

Please sign in to comment.