Skip to content

Commit

Permalink
Use Iterator::copied
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrubeck committed Oct 12, 2020
1 parent e81835c commit 9691328
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/iter/copied.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,10 @@ where
T: 'a + Copy,
{
type Item = T;
type IntoIter = iter::Cloned<P::IntoIter>;
type IntoIter = iter::Copied<P::IntoIter>;

fn into_iter(self) -> Self::IntoIter {
// FIXME: use `Iterator::copied()` when Rust 1.36 is our minimum.
self.base.into_iter().cloned()
self.base.into_iter().copied()
}

fn min_len(&self) -> usize {
Expand Down Expand Up @@ -210,8 +209,7 @@ where
where
I: IntoIterator<Item = &'a T>,
{
// FIXME: use `Iterator::copied()` when Rust 1.36 is our minimum.
self.base = self.base.consume_iter(iter.into_iter().cloned());
self.base = self.base.consume_iter(iter.into_iter().copied());
self
}

Expand Down

0 comments on commit 9691328

Please sign in to comment.