minor: use minicore

This commit is contained in:
Aleksey Kladov 2021-06-18 23:48:18 +03:00
parent a9623f3165
commit 90da9fc9b3
2 changed files with 43 additions and 69 deletions

View file

@ -22,7 +22,7 @@
//! option:
//! result:
//! iterator: option
//! iterators: iterator
//! iterators: iterator, fn
//! default: sized
//! clone: sized
//! copy: clone
@ -390,7 +390,6 @@ pub mod iter {
iter: I,
n: usize,
}
impl<I> Iterator for Take<I>
where
I: Iterator,
@ -401,6 +400,22 @@ pub mod iter {
loop {}
}
}
pub struct FilterMap<I, F> {
iter: I,
f: F,
}
impl<B, I: Iterator, F> Iterator for FilterMap<I, F>
where
F: FnMut(I::Item) -> Option<B>,
{
type Item = B;
#[inline]
fn next(&mut self) -> Option<B> {
loop {}
}
}
}
pub use self::adapters::Take;
@ -448,6 +463,13 @@ pub mod iter {
fn take(self, n: usize) -> crate::iter::Take<Self> {
loop {}
}
fn filter_map<B, F>(self, f: F) -> crate::iter::FilterMap<Self, F>
where
Self: Sized,
F: FnMut(Self::Item) -> Option<B>,
{
loop {}
}
// endregion:iterators
}
impl<I: Iterator + ?Sized> Iterator for &mut I {