Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add peek_first #26

Open
foresterre opened this issue Sep 20, 2019 · 0 comments
Open

Add peek_first #26

foresterre opened this issue Sep 20, 2019 · 0 comments
Labels
A-high-level-api Area: for API's where the queue buffer management is handled internally C-enhancement good first issue Github global label for issues and PRs for new contributors. Always also use: status = help-wanted Hacktoberfest help wanted Github global label for issues and PRs for new contributors. Always also use: status = help-wanted

Comments

@foresterre
Copy link
Owner

foresterre commented Sep 20, 2019

Always peeks at the first element regardless of where the cursor is.

@foresterre foresterre changed the title Add 'peek_first' Add peek_first Sep 20, 2019
@foresterre foresterre added C-enhancement good first issue Github global label for issues and PRs for new contributors. Always also use: status = help-wanted Hacktoberfest help wanted Github global label for issues and PRs for new contributors. Always also use: status = help-wanted and removed kind = enhancement labels Aug 26, 2020
@foresterre foresterre added the A-high-level-api Area: for API's where the queue buffer management is handled internally label Sep 4, 2020
bors bot added a commit that referenced this issue Feb 18, 2023
61: Fix for Issue #26 r=foresterre a=ForgottenMaster

I've added a peek_first method to the iterator which is simply a wrapper around peek_nth(0) that allows access to the first unconsumed element in the iterator regardless of cursor position.

Also added a unit test for this method.

Co-authored-by: Robin Firth <theforgottenmaster@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-high-level-api Area: for API's where the queue buffer management is handled internally C-enhancement good first issue Github global label for issues and PRs for new contributors. Always also use: status = help-wanted Hacktoberfest help wanted Github global label for issues and PRs for new contributors. Always also use: status = help-wanted
Projects
None yet
Development

No branches or pull requests

1 participant