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 method #61

Merged
merged 1 commit into from
Feb 18, 2023
Merged

Add peek_first method #61

merged 1 commit into from
Feb 18, 2023

Conversation

ForgottenMaster
Copy link
Contributor

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.

@foresterre
Copy link
Owner

Thanks!

bors r+

@foresterre
Copy link
Owner

bors try

@codecov-commenter
Copy link

Codecov Report

❗ No coverage uploaded for pull request base (main@29ed148). Click here to learn what that means.
Patch has no changes to coverable lines.

Additional details and impacted files
@@           Coverage Diff           @@
##             main      #61   +/-   ##
=======================================
  Coverage        ?   99.40%           
=======================================
  Files           ?        1           
  Lines           ?     1016           
  Branches        ?        0           
=======================================
  Hits            ?     1010           
  Misses          ?        6           
  Partials        ?        0           

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

…eference to the first unconsumed element of the iterator regardless of where the cursor currently is. This is simply a wrapper around peek_nth with n=0 since that function does not modify the cursor
@foresterre
Copy link
Owner

bors r+

@bors
Copy link
Contributor

bors bot commented Feb 18, 2023

@bors bors bot merged commit a5a082c into foresterre:main Feb 18, 2023
@foresterre foresterre changed the title Fix for Issue #26 Add peek_first method Feb 18, 2023
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.

3 participants