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

Trait impls for tuples of arity <= 12 #475

Merged
merged 1 commit into from Sep 22, 2020

Conversation

jswrenn
Copy link
Member

@jswrenn jswrenn commented Sep 4, 2020

I stopped at 12, because that's where libcore stops.

fixes #428
fixes #398

following the convention of libcore

fixes rust-itertools#428
fixes rust-itertools#398
Comment on lines -288 to +290
loop {
$(
let $Y = if let Some($Y) = iter.next() {
$Y
} else {
break;
};
)*
return Some(($($Y),*,))
}

return None;
Some(($(
{ let $Y = iter.next()?; $Y },
)*))
Copy link
Member Author

Choose a reason for hiding this comment

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

I think this modification is semantically equivalent, but I'd love if someone else could check it over before I merge.

Copy link
Member

@phimuemue phimuemue Sep 14, 2020

Choose a reason for hiding this comment

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

Looks good to me. Godbolt even seems to generate very similar code in --release.

off-topic: I do not have much time to spare at the moment, so I will be slow to respond.

@jswrenn
Copy link
Member Author

jswrenn commented Sep 4, 2020

Seems like a random CI failure?

bors try

bors bot added a commit that referenced this pull request Sep 4, 2020
@bors
Copy link
Contributor

bors bot commented Sep 4, 2020

try

Build failed:

@jswrenn jswrenn added this to the next milestone Sep 5, 2020
@phimuemue
Copy link
Member

bors try

bors bot added a commit that referenced this pull request Sep 14, 2020
@bors
Copy link
Contributor

bors bot commented Sep 14, 2020

try

Build failed:

@phimuemue phimuemue mentioned this pull request Sep 19, 2020
@jswrenn
Copy link
Member Author

jswrenn commented Sep 22, 2020

bors r+

@bors
Copy link
Contributor

bors bot commented Sep 22, 2020

Build succeeded:

@bors bors bot merged commit af54286 into rust-itertools:master Sep 22, 2020
bors bot added a commit that referenced this pull request Sep 22, 2020
478: Simplify tuple macro r=jswrenn a=phimuemue

This is a follow-up to (i.e. builds upon) #475, doing some of the mentioned "macro cleverness" in the comments.

Co-authored-by: philipp <descpl@yahoo.de>
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.

HomogeneousTuple / TupleCollect for N > 4 ? add implementation of 5-tuple for tuple_combinations?
2 participants