Skip to content

Trait impls for tuples of arity <= 12#475

Merged
bors[bot] merged 1 commit intorust-itertools:masterfrom
jswrenn:tuple-impls
Sep 22, 2020
Merged

Trait impls for tuples of arity <= 12#475
bors[bot] merged 1 commit intorust-itertools:masterfrom
jswrenn:tuple-impls

Conversation

@jswrenn
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

bors bot commented Sep 4, 2020

try

Build failed:

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

bors try

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

bors bot commented Sep 14, 2020

try

Build failed:

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

jswrenn commented Sep 22, 2020

bors r+

@bors
Copy link
Copy Markdown
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