Skip to content

take_until and map_until #597

@JohnScience

Description

@JohnScience

A while ago there was a proposal by Jon Gjengset (jonhoo) to add take_until into Rust's standard library:
rust-lang/rust#62208

While it may be not a good fit for the standard library, it might be a worthwhile addition to itertools.

As michaelsproul pointed out in the discussion,

I don't think take_while_ref or peeking_take_while are well suited to this because they require you to assign the iterator to a local variable, and muck around with mutation, which breaks the flow of the iterator chain. The best I could do with them was this, which isn't as nice as take_until.

If you don't mind, I'd be happy to try and get your code into itertools, giving you credit of course! (Co-authored-by on the commit)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions