Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/adaptors/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ where
}

/// Create a new `TakeWhileRef` from a reference to clonable iterator.
pub fn take_while_ref<I, F>(iter: &mut I, f: F) -> TakeWhileRef<I, F>
pub fn take_while_ref<I, F>(iter: &mut I, f: F) -> TakeWhileRef<'_, I, F>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh, nice, I'm a big fan of these '_s-in-return-types.

where
I: Iterator + Clone,
{
Expand Down
8 changes: 4 additions & 4 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1518,7 +1518,7 @@ pub trait Itertools: Iterator {
///
/// See also [`.take_while_ref()`](Itertools::take_while_ref)
/// which is a similar adaptor.
fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<Self, F>
fn peeking_take_while<F>(&mut self, accept: F) -> PeekingTakeWhile<'_, Self, F>
where
Self: Sized + PeekingNext,
F: FnMut(&Self::Item) -> bool,
Expand All @@ -1543,7 +1543,7 @@ pub trait Itertools: Iterator {
/// assert_eq!(decimals, "0123456789");
/// assert_eq!(hexadecimals.next(), Some('a'));
/// ```
fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<Self, F>
fn take_while_ref<F>(&mut self, accept: F) -> TakeWhileRef<'_, Self, F>
where
Self: Clone,
F: FnMut(&Self::Item) -> bool,
Expand Down Expand Up @@ -2506,7 +2506,7 @@ pub trait Itertools: Iterator {
/// format!("{:.2}", data.iter().format(", ")),
/// "1.10, 2.72, -3.00");
/// ```
fn format(self, sep: &str) -> Format<Self>
fn format(self, sep: &str) -> Format<'_, Self>
where
Self: Sized,
{
Expand Down Expand Up @@ -2545,7 +2545,7 @@ pub trait Itertools: Iterator {
///
///
/// ```
fn format_with<F>(self, sep: &str, format: F) -> FormatWith<Self, F>
fn format_with<F>(self, sep: &str, format: F) -> FormatWith<'_, Self, F>
where
Self: Sized,
F: FnMut(Self::Item, &mut dyn FnMut(&dyn fmt::Display) -> fmt::Result) -> fmt::Result,
Expand Down
2 changes: 1 addition & 1 deletion src/peeking_take_while.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ where
}

/// Create a `PeekingTakeWhile`
pub fn peeking_take_while<I, F>(iter: &mut I, f: F) -> PeekingTakeWhile<I, F>
pub fn peeking_take_while<I, F>(iter: &mut I, f: F) -> PeekingTakeWhile<'_, I, F>
where
I: Iterator,
{
Expand Down
4 changes: 2 additions & 2 deletions tests/test_std.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,13 +443,13 @@ fn kmerge_empty() {

#[test]
fn kmerge_size_hint() {
let its = (0..5).map(|_| (0..10));
let its = (0..5).map(|_| 0..10);
assert_eq!(its.kmerge().size_hint(), (50, Some(50)));
}

#[test]
fn kmerge_empty_size_hint() {
let its = (0..5).map(|_| (0..0));
let its = (0..5).map(|_| 0..0);
assert_eq!(its.kmerge().size_hint(), (0, Some(0)));
}

Expand Down
Loading