Skip to content

Draw attention to Position::Only in docs #1043

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

Merged
merged 1 commit into from
Jul 7, 2025

Conversation

kornelski
Copy link
Contributor

Just documentation improvements from #1042 without API changes.

First,
/// This is neither the first nor the last element.
Middle,
/// This is the last element.
/// This is the last element, and there was more than one element.
Last,
/// This is the only element.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe to parallel,

Suggested change
/// This is the only element.
/// This is the only element, and thus both the first *and* the last.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've intentionally left it unsaid, because even though it's first or last, it's not First nor Last (a custom PartialEq implementation could make it possible for Only to equal First and Last too, but that's not the case).

Copy link

codecov bot commented Jul 6, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.26%. Comparing base (6814180) to head (ebd8827).
Report is 151 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1043      +/-   ##
==========================================
- Coverage   94.38%   94.26%   -0.13%     
==========================================
  Files          48       50       +2     
  Lines        6665     6226     -439     
==========================================
- Hits         6291     5869     -422     
+ Misses        374      357      -17     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@phimuemue phimuemue left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Accepting this, it's strictly better than what we have now.

@phimuemue phimuemue added this pull request to the merge queue Jul 7, 2025
Merged via the queue into rust-itertools:master with commit b40b06b Jul 7, 2025
9 of 14 checks passed
@kornelski kornelski deleted the last-footgun branch July 7, 2025 11:25
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