IssueRaiser

Tracking Issue for `Iterator::intersperse`

<!-- homu-ignore:start --> *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/issues/79524)* <!-- homu-ignore:end --> This is a tracking issue for the `Iterator::intersperse` and `intersperse_with` methods. It is based on `itertools::intersperse` and is the iterator equivalent of `Vec::join`. The feature gate for the issue is `#![feature(iter_intersperse)]`. ### Public API ```rust // core::iter pub trait Iterator { fn intersperse(self, separator: Self::Item) -> Intersperse<Self> where Self: Sized, Self::Item: Clone; fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> where Self: Sized, G: FnMut() -> Self::Item; } #[derive(Debug, Clone)] pub struct Intersperse<I: Iterator> where I::Item: Clone {} impl<I> Iterator for Intersperse<I> where I: Iterator, I::Item: Clone { type Item = I::Item; } pub struct IntersperseWith<I, G> where I: Iterator {} impl<I, G> Debug for IntersperseWith<I, G> where I: Iterator + Debug, I::Item: Debug, G: Debug {} impl<I, G> Clone for IntersperseWith<I, G> where I: Iterator + Clone, I::Item: Clone, G: Clone {} impl<I, G> Iterator for IntersperseWith<I, G> where I: Iterator, G: FnMut() -> I::Item { type Item = I::Item; } ``` ### Steps / History <!-- Include each step required to complete the feature. Typically this is a PR implementing a feature, followed by a PR that stabilises the feature. However for larger features an implementa

Posted by camelid on Nov 28, 2020, 11:51 PM

Tags

Related issues

Raise real-world problems, find people facing the same issue, and discuss solutions.3,000 issues0 comments

github (Sysadmin)

Tracking Issue for `Iterator::intersperse`

camelidNov 28, 2020, 11:51 PM

<!-- homu-ignore:start --> *[View all comments](https://triagebot.infra.rust-lang.org/gh-comments/rust-lang/rust/issues/79524)* <!-- homu-ignore:end --> This is a tracking issue for the `Iterator::intersperse` and `intersperse_with` methods. It is based on `itertools::intersperse` and is the iterator equivalent of `Vec::join`. The feature gate for the issue is `#![feature(iter_intersperse)]`. ### Public API ```rust // core::iter pub trait Iterator { fn intersperse(self, separator: Self::Item) -> Intersperse<Self> where Self: Sized, Self::Item: Clone; fn intersperse_with<G>(self, separator: G) -> IntersperseWith<Self, G> where Self: Sized, G: FnMut() -> Self::Item; } #[derive(Debug, Clone)] pub struct Intersperse<I: Iterator> where I::Item: Clone {} impl<I> Iterator for Intersperse<I> where I: Iterator, I::Item: Clone { type Item = I::Item; } pub struct IntersperseWith<I, G> where I: Iterator {} impl<I, G> Debug for IntersperseWith<I, G> where I: Iterator + Debug, I::Item: Debug, G: Debug {} impl<I, G> Clone for IntersperseWith<I, G> where I: Iterator + Clone, I::Item: Clone, G: Clone {} impl<I, G> Iterator for IntersperseWith<I, G> where I: Iterator, G: FnMut() -> I::Item { type Item = I::Item; } ``` ### Steps / History <!-- Include each step required to complete the feature. Typically this is a PR implementing a feature, followed by a PR that stabilises the feature. However for larger features an implementa

Comments (0)

No comments yet. Start the discussion.

Comment on this issue