From c42cdff3d2ed2e30add09dd0d602181b6f83534d Mon Sep 17 00:00:00 2001 From: Aleksey Kladov Date: Thu, 17 Jun 2021 11:28:44 +0300 Subject: internal: minimize minicore We want to keep minicore small, so let's split out iterator adapters and sources into a separate `iterators` region, and use them only when needed. --- crates/test_utils/src/minicore.rs | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'crates/test_utils/src') diff --git a/crates/test_utils/src/minicore.rs b/crates/test_utils/src/minicore.rs index 1a0573d7a..e6d2301c7 100644 --- a/crates/test_utils/src/minicore.rs +++ b/crates/test_utils/src/minicore.rs @@ -21,6 +21,7 @@ //! option: //! result: //! iterator: option +//! iterators: iterator pub mod marker { // region:sized @@ -209,6 +210,7 @@ pub mod task { // region:iterator pub mod iter { + // region:iterators mod adapters { pub struct Take { iter: I, @@ -249,6 +251,7 @@ pub mod iter { pub use self::repeat::{repeat, Repeat}; } pub use self::sources::{repeat, Repeat}; + // endregion:iterators mod traits { mod iterator { @@ -261,15 +264,17 @@ pub mod iter { fn nth(&mut self, n: usize) -> Option { loop {} } - fn take(self, n: usize) -> crate::iter::Take { - loop {} - } fn by_ref(&mut self) -> &mut Self where Self: Sized, { self } + // region:iterators + fn take(self, n: usize) -> crate::iter::Take { + loop {} + } + // endregion:iterators } impl Iterator for &mut I { type Item = I::Item; -- cgit v1.2.3