Skip to content

Make MultiPeek consistent with Peekable#1

Open
mysteriouslyseeing wants to merge 3 commits into
LukeMathWalker:mainfrom
mysteriouslyseeing:next_if-next_if_eq
Open

Make MultiPeek consistent with Peekable#1
mysteriouslyseeing wants to merge 3 commits into
LukeMathWalker:mainfrom
mysteriouslyseeing:next_if-next_if_eq

Conversation

@mysteriouslyseeing

Copy link
Copy Markdown

MultiPeek is missing 2 methods from Peekable: next_if and next_if_eq. This pull request adds those two methods and two additional ones: nth_if and nth_if_eq. This will make MultiPeek a drop-in replacement for Peekable in the standard library.

Description of changes:
Added next_if, nth_if, next_if_eq and nth_if_eq.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Added next_if, nth_if, next_if_eq and nth_if_eq, making multipeek a drop-in replacement for std's Peekable.
@mysteriouslyseeing

Copy link
Copy Markdown
Author

I just realised that this is not enough; peek_mut (and peek_nth_mut) are also required. I'll add them to the PR in the morning.

Added the peek_mut and peek_nth_mut methods
@mysteriouslyseeing

mysteriouslyseeing commented Apr 29, 2023

Copy link
Copy Markdown
Author

I've now added the two methods that were missing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant