-
Notifications
You must be signed in to change notification settings - Fork 309
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
Audit for missing fold
implementations.
#755
Comments
Note that the vast majority of the time, you should be overriding The default Thus the only reason to override |
Whoops, yes, of course. I'll modify the issue accordingly. |
for_each
implementations. fold
implementations.
Once we do this, we should test all of them via |
I'm interested to contribute to this crate and I digged a bit into the source code. I think one potential candidate to override https://github.com/rust-itertools/itertools/blob/master/src/combinations.rs#L100 What do you guys think ? I can create a PR in coming few days to implement this. |
@Philippe-Cholet I think you're the most knowledgeable there. Could you mentor/review this? |
I previously had some thoughts about spliting |
@jswrenn @phimuemue I've been editing a lot my comment above, and I would like to have feedback on it. |
@jswrenn, I'd love to get started contributing to Rust, but I'd need a little help getting started since this would be my first ever GitHub contribution. You mention you're happy to provide mentorship in your initial post, so I'm eager to get to work if you could help me out with any of the items on the checklist. Thanks! |
@DavidCoy77 I guess that specialize |
Hi @DavidCoy77, apologies for not replying to your emails — I've been traveling. I agree with @Philippe-Cholet that our fold implementations are the best place to start. |
Great! Thank you for the help @jswrenn and @Philippe-Cholet. I've spent some time looking at the |
EDIT: The text below is a bit outdated as benchmarks and specializations are now written for most of our iterators. Write the @DavidCoy77 I guess there is a lot of new things (I did not know criterion and quickcheck before coming here, and was not that familiar with
You can focus on figuring out
EDIT: |
@jswrenn I'm curious but don't understand the exact intention behind this yet:
A lint that warn us about missing |
Yes, the idea is to add lints to clippy itself to warn us about missing |
I'm looking to give this issue a try. |
@luander I can happily mentor you on this.
EDIT: Alternatively, |
If clippy does not accept the lint, we could maybe (cleverly ab)use |
I think it'll be accepted (and about EDIT: I might keep my fork and have a branch implementing other lints if keep it updated is simple enough. |
Update on the lint idea: After discussion on zulip, |
My poor man's approach to fint missing
|
@phimuemue Oh... I find embarrassing I was aware about After some tinkering on jq playground, I think I have a new git alias (it's not git-related but useful anyway):
then
Output for `git missing-trait-methods Iterator size_hint`
|
@jswrenn A lint
The downside is that allow the lint on a Is that okay with you? If it is, I'll work on making the lint configurable. |
Making |
@Philippe-Cholet Hi there, on // increment_indices returns true once we run out of combinations
while !self.increment_indices() {
combination = self.indices.iter().map(|i| self.pool[*i].clone()).collect();
acc = f(acc, combination)
} If you think that looks reasonable I'll put through a PR. Edit: I tried this out and, although it works, it is markedly slower than the unspecialized implementation |
@kinto-b We won't specialize it if it's slower (but that alone is a valuable information). About combinations, the slowest thing is heap-allocate the generated items. I will eventually work again on configure |
Implementing
fold
for our iterators allows us to provide more performant internal iteration. We provide it in some cases, but not all. I'd like us to take three steps towards resolving this:fold
.fold
for missing adapters.Happy to provide mentorship for any of these items.
The text was updated successfully, but these errors were encountered: