-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
Implement Show for 1-12 element tuples and improve the std::tuple API #12313
Conversation
new_branch = new_outcome.clone().n0(); | ||
outcome = new_outcome.n1(); | ||
new_branch = new_outcome.get_0().clone(); | ||
outcome = new_outcome.get_1().clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're adding extra clones here (not that it matters much given how many clones are in this file), it should really be
let (next_branch, next_outcome) = self.clone().rightmost_child.insert(...);
new_branch = next_branch;
outcome = next_outcome;
to avoid the clones. (And below too)
Less clutter in the prelude! Yay! |
fn $mutN<'a>(&'a mut self) -> &'a mut $T { | ||
// Do this because the macro invocation would exceed | ||
// the 100 character limit if it also required a | ||
// $mut_pattern:pat |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seriously? You'll use unsafe code and violate some (possible) type invariants for a formatting issue?
Renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters.
These are adequately covered by the Tuple2 trait.
(n0, n0_ref) -> A { (a,_), (ref a,_) => a } | ||
(n1, n1_ref) -> B { (_,b), (_,ref b) => b } | ||
Tuple2 { | ||
(val0, ref0, mut0) -> A { (a, b) => a } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder if it's possible to move the (a, b, ...)
bit of the macro expansion to near the Tuple<N>
to only need to write it once for each tuple size.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm, I tried this but I was getting complaints about the expansion depth.
Bors didn't seem picking up the r+, so I'm trying a 'r=huonw'. |
This renames the `n*` and `n*_ref` tuple getters to `val*` and `ref*` respectively, and adds `mut*` getters. It also removes the `CloneableTuple` and `ImmutableTuple` traits.
awesome, Thanks! |
Removed duplicate 'to' in `cachePriming.numThreads` option description One 'to' too many!
Upgrade anstream to 0.6.0 *Please write a short comment explaining your change (or "none" for internal only changes)* changelog: none
This renames the
n*
andn*_ref
tuple getters toval*
andref*
respectively, and addsmut*
getters. It also removes theCloneableTuple
andImmutableTuple
traits.