mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-27 20:42:04 +00:00
internal: cleanup tests
This commit is contained in:
parent
ee7b649d44
commit
35772256f8
2 changed files with 140 additions and 72 deletions
|
@ -209,8 +209,29 @@ pub mod task {
|
|||
|
||||
// region:iterator
|
||||
pub mod iter {
|
||||
mod adapters {
|
||||
pub struct Take<I> {
|
||||
iter: I,
|
||||
n: usize,
|
||||
}
|
||||
|
||||
impl<I> Iterator for Take<I>
|
||||
where
|
||||
I: Iterator,
|
||||
{
|
||||
type Item = <I as Iterator>::Item;
|
||||
|
||||
fn next(&mut self) -> Option<<I as Iterator>::Item> {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub use self::adapters::Take;
|
||||
|
||||
mod traits {
|
||||
mod iterator {
|
||||
use super::super::Take;
|
||||
|
||||
pub trait Iterator {
|
||||
type Item;
|
||||
#[lang = "next"]
|
||||
|
@ -218,8 +239,13 @@ pub mod iter {
|
|||
fn nth(&mut self, n: usize) -> Option<Self::Item> {
|
||||
loop {}
|
||||
}
|
||||
fn take(self, n: usize) -> crate::iter::Take<Self> {
|
||||
loop {}
|
||||
}
|
||||
}
|
||||
}
|
||||
pub use self::iterator::Iterator;
|
||||
|
||||
mod collect {
|
||||
pub trait IntoIterator {
|
||||
type Item;
|
||||
|
@ -236,7 +262,6 @@ pub mod iter {
|
|||
}
|
||||
}
|
||||
pub use self::collect::IntoIterator;
|
||||
pub use self::iterator::Iterator;
|
||||
}
|
||||
pub use self::traits::{IntoIterator, Iterator};
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue