From 35772256f8ff3c52e469fc2bd388ad80ff8d79c7 Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Wed, 16 Jun 2021 23:27:04 +0300 Subject: internal: cleanup tests --- crates/test_utils/src/minicore.rs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) (limited to 'crates/test_utils/src') diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index a861ff09c..2f0da7fe5 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs @@ -209,8 +209,29 @@ pub mod task { // region:iterator pub mod iter { + mod adapters { + pub struct Take { + iter: I, + n: usize, + } + + impl Iterator for Take + where + I: Iterator, + { + type Item = ::Item; + + fn next(&mut self) -> Option<::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 { loop {} } + fn take(self, n: usize) -> crate::iter::Take { + 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}; } -- cgit v1.2.3