Skip to content

feat(FilterMapOk): implement DoubleEndedIterator - #950

Merged
Philippe-Cholet merged 2 commits into
rust-itertools:masterfrom
Xenira:filtermapok-doubleended
May 27, 2024
Merged

feat(FilterMapOk): implement DoubleEndedIterator#950
Philippe-Cholet merged 2 commits into
rust-itertools:masterfrom
Xenira:filtermapok-doubleended

Conversation

@Xenira

Copy link
Copy Markdown
Contributor

DoubleEndedIterator implementation for FilterMapOk analog to #948.

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

Refs: #947

@codecov

codecovBot commented May 27, 2024

Copy link
Copy Markdown

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.

@Philippe-CholetPhilippe-Cholet left a comment

Copy link
Copy Markdown
Member

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
Copy Markdown
ContributorAuthor

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 queueMay 27, 2024
@Philippe-Cholet

Copy link
Copy Markdown
Member

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

@Philippe-CholetPhilippe-Cholet added this to the next milestone May 27, 2024
Merged via the queue into rust-itertools:master with commit ad5cc96May 27, 2024
@scottmcm

Copy link
Copy Markdown
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
Copy Markdown
ContributorAuthor

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 freeto 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

@Xenira@Philippe-Cholet@scottmcm