Skip to content

Conversation

brendanzab
Copy link
Contributor

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.

Copy link
Contributor

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)

@brendanzab
Copy link
Contributor Author

Less clutter in the prelude! Yay!

Copy link
Contributor

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.
Copy link
Contributor

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.

Copy link
Contributor Author

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.

@brendanzab
Copy link
Contributor Author

Bors didn't seem picking up the r+, so I'm trying a 'r=huonw'.

bors added a commit that referenced this pull request Feb 16, 2014
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.
@bors bors closed this Feb 16, 2014
@bors bors merged commit f450b2b into rust-lang:master Feb 16, 2014
@brendanzab brendanzab deleted the tuple branch February 16, 2014 16:22
@flaper87
Copy link
Contributor

awesome, Thanks!

bors added a commit to rust-lang-ci/rust that referenced this pull request Jul 25, 2022
Removed duplicate 'to' in `cachePriming.numThreads` option description

One 'to' too many!
flip1995 pushed a commit to flip1995/rust that referenced this pull request Feb 26, 2024
Upgrade anstream to 0.6.0

*Please write a short comment explaining your change (or "none" for internal only changes)*

changelog: none
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.

4 participants