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

feat(FilterMapOk): implement DoubleEndedIterator #950

Merged
merged 2 commits into from
May 27, 2024

Conversation

Xenira
Copy link
Contributor

@Xenira Xenira commented May 27, 2024

DoubleEndedIterator implementation for FilterMapOk analog to #948.

Hope rev() is the right thing here, as rfind_map does not exist (#949).

Refs: #947

Copy link

codecov bot commented May 27, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.52%. Comparing base (6814180) to head (aa547c6).
Report is 98 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #950      +/-   ##
==========================================
+ Coverage   94.38%   94.52%   +0.13%     
==========================================
  Files          48       49       +1     
  Lines        6665     7046     +381     
==========================================
+ Hits         6291     6660     +369     
- Misses        374      386      +12     

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

Copy link
Member

@Philippe-Cholet Philippe-Cholet left a comment

Choose a reason for hiding this comment

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

You did not need to make a merge commit.

.by_ref().rev().find_map( is verbose but it's not unprecedented like for Unique::next_back and it's fine.

@Xenira
Copy link
Contributor Author

Xenira commented May 27, 2024

You did not need to make a merge commit.

Wanted to rebase, but messed up. Like my pr's to be up to date :)

@Philippe-Cholet Philippe-Cholet added this pull request to the merge queue May 27, 2024
@Philippe-Cholet
Copy link
Member

No prob, the commit history is not that clean anyway.

@Philippe-Cholet Philippe-Cholet added this to the next milestone May 27, 2024
Merged via the queue into rust-itertools:master with commit ad5cc96 May 27, 2024
13 checks passed
@scottmcm
Copy link
Contributor

Hmm, maybe the other option would be .filter_map(p).next_back(), inspired by rust-lang/rust#49098 ?

The rev is probably fine, though, so probably doesn't need to be changed.

@Xenira
Copy link
Contributor Author

Xenira commented May 27, 2024

Benchmarked against the filter_map variant and its mostly in noise threshold. (2 cases 2% faster but I guess, thats because different base load on my system).

The rev() is more readable though.

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.

None yet

3 participants