aboutsummaryrefslogtreecommitdiff
path: root/src/rciter_impl.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/rciter_impl.rs')
-rw-r--r--src/rciter_impl.rs9
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()
}
}