multipeek icon indicating copy to clipboard operation
multipeek copied to clipboard

Make MultiPeek consistent with Peekable

Open mysteriouslyseeing opened this issue 1 year ago • 2 comments

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.

mysteriouslyseeing avatar Apr 29 '23 15:04 mysteriouslyseeing

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.

mysteriouslyseeing avatar Apr 29 '23 15:04 mysteriouslyseeing

I've now added the two methods that were missing

mysteriouslyseeing avatar Apr 29 '23 23:04 mysteriouslyseeing