diff options
author | Joel Galenson <jgalenson@google.com> | 2021-04-01 17:03:06 -0700 |
---|---|---|
committer | Joel Galenson <jgalenson@google.com> | 2021-04-01 17:03:06 -0700 |
commit | 6f798715de3d4bd744116190d14a413445542820 (patch) | |
tree | 70e883bc01ba2b4d8dd07e0347be18a2fbbd2c18 /src/rciter_impl.rs | |
parent | a06122cf145ade58c23ae76bcf31d9c748dce354 (diff) | |
download | itertools-6f798715de3d4bd744116190d14a413445542820.tar.gz |
Upgrade rust/crates/itertools to 0.10.0android-s-beta-2android-s-beta-1
Test: make
Change-Id: Ie8b53cb0a96fd9adcbf7f4afa3b966849fc2ff24
Diffstat (limited to 'src/rciter_impl.rs')
-rw-r--r-- | src/rciter_impl.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/rciter_impl.rs b/src/rciter_impl.rs index 6ee90ad..9122dad 100644 --- a/src/rciter_impl.rs +++ b/src/rciter_impl.rs @@ -1,6 +1,6 @@ use std::iter::IntoIterator; -use std::rc::Rc; +use alloc::rc::Rc; use std::cell::RefCell; /// A wrapper for `Rc<RefCell<I>>`, that implements the `Iterator` trait. @@ -60,7 +60,7 @@ impl<A, I> Iterator for RcIter<I> { type Item = A; #[inline] - fn next(&mut self) -> Option<A> { + fn next(&mut self) -> Option<Self::Item> { self.rciter.borrow_mut().next() } @@ -69,8 +69,7 @@ impl<A, I> Iterator for RcIter<I> // To work sanely with other API that assume they own an iterator, // so it can't change in other places, we can't guarantee as much // in our size_hint. Other clones may drain values under our feet. - let (_, hi) = self.rciter.borrow().size_hint(); - (0, hi) + (0, self.rciter.borrow().size_hint().1) } } @@ -78,7 +77,7 @@ impl<I> DoubleEndedIterator for RcIter<I> where I: DoubleEndedIterator { #[inline] - fn next_back(&mut self) -> Option<I::Item> { + fn next_back(&mut self) -> Option<Self::Item> { self.rciter.borrow_mut().next_back() } } |