Rename first*/last* BTree{Set,Map} methods to min*/max*#93709
Rename first*/last* BTree{Set,Map} methods to min*/max*#93709WaffleLapkin wants to merge 1 commit intorust-lang:masterfrom
first*/last* BTree{Set,Map} methods to min*/max*#93709Conversation
|
r? @m-ou-se (rust-highfive has picked a reviewer for you, use r? to override) |
This comment has been minimized.
This comment has been minimized.
b353837 to
ea88efc
Compare
|
☔ The latest upstream changes (presumably #94350) made this pull request unmergeable. Please resolve the merge conflicts. |
Note: `BTreeSet::{first,last}` are renamed to `{get_min,get_max}` to
avoid conflicts with `Ord::{min,max}`.
ea88efc to
7876b5b
Compare
|
☔ The latest upstream changes (presumably #92962) made this pull request unmergeable. Please resolve the merge conflicts. |
|
We discussed this in the libs-api meeting last week. Having to use |
|
That's very unfortunate, though understandable. (and also surprising since generally inherit methods take over the trait ones (but turns out |
On the tracking issue there a lot of discussions on the names of these methods.
I propose that
min*/max*(reasoning below)TL;DR this PR renames first*/last* methods of
BTreeMapandBTreeSetas follows:In my opinion min/max terminology is a lot more self-documenting and less ambiguous. You can actually see that documentation is simplified a little, because there is no need to explain what "first" and "last" mean. The fact that first/last required explanation that they actually mean min/max suggests that min/max is a better naming.
You may also notice that std's usage of
BTreeSetbinded values returned from these methods to variables with_minand_max, which implies that this is what the code cares about and not firstness/lastness: