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

LazyBuffer::get_at (+ simplify Combinations::nth) #917

Merged

Conversation

kinto-b
Copy link
Contributor

@kinto-b kinto-b commented Apr 17, 2024

As requested in #914 (comment), I've added a helper for returning the 'current' combination.

I also realised that there's no reason to delegate from .nth to .next() when n==0 so I junked it.

src/combinations.rs Show resolved Hide resolved
src/combinations.rs Outdated Show resolved Hide resolved
@Philippe-Cholet Philippe-Cholet changed the title Simplify combinations LazyBuffer::from_indices (+ simplify Combinations::nth) Apr 17, 2024
Copy link

codecov bot commented Apr 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.45%. Comparing base (6814180) to head (68df645).
Report is 54 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #917      +/-   ##
==========================================
+ Coverage   94.38%   94.45%   +0.06%     
==========================================
  Files          48       48              
  Lines        6665     6866     +201     
==========================================
+ Hits         6291     6485     +194     
- Misses        374      381       +7     

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

@Philippe-Cholet Philippe-Cholet changed the title LazyBuffer::from_indices (+ simplify Combinations::nth) LazyBuffer::get_at (+ simplify Combinations::nth) Apr 17, 2024
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.

Away from the keyboard, I thought that from_ methods usually are constructors (returns Self) which is not the case here. So get_at is a better name than my suggested from_indices.

I'll merge this once the requested change is done, thanks.

src/permutations.rs Outdated Show resolved Hide resolved
@Philippe-Cholet Philippe-Cholet added this to the next milestone Apr 17, 2024
@Philippe-Cholet Philippe-Cholet self-assigned this Apr 17, 2024
@Philippe-Cholet Philippe-Cholet added this pull request to the merge queue Apr 18, 2024
Merged via the queue into rust-itertools:master with commit f7d557d Apr 18, 2024
13 checks passed
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

2 participants