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

Add a map method to Bound #83646

Merged
merged 1 commit into from
Jun 5, 2021
Merged

Add a map method to Bound #83646

merged 1 commit into from
Jun 5, 2021

Conversation

glittershark
Copy link
Contributor

Add a map method to std::ops::range::Bound, patterned off of the method
of the same name on Option.

Have left off creating a tracking issue initially, but as soon as I get the go-ahead from a reviewer I'll make that right away 😄

@rust-highfive
Copy link
Collaborator

r? @sfackler

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Mar 29, 2021
@rust-log-analyzer

This comment has been minimized.

@rust-log-analyzer

This comment has been minimized.

@glittershark
Copy link
Contributor Author

@pickfire thanks for the review! Applied your suggestions.

@crlf0710 crlf0710 added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 17, 2021
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 4, 2021
@crlf0710 crlf0710 added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 22, 2021
@Dylan-DPC-zz
Copy link

r? @m-ou-se

@rust-highfive rust-highfive assigned m-ou-se and unassigned sfackler May 23, 2021
@m-ou-se
Copy link
Member

m-ou-se commented May 24, 2021

@glittershark Can you give some motivating examples for adding this to the standard library? I can't think of many situations where this function would be used, and the doc example you included seems a bit contrived.

@m-ou-se m-ou-se added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 24, 2021
@glittershark
Copy link
Contributor Author

@m-ou-se at work we use Bounds to represent range lookups on compound indices (for a database), and we use (an extension trait providing) the map method to do things like turning bounds of vecs into bounds of tuples once we're in a place where the length is known statically, or to serialize the contents of a bound when doing lookups into lower-level storage layers (rocksdb, in our case). To give a sense of scale, that extension trait is imported 11 times in a >100KLoC codebase.

@m-ou-se
Copy link
Member

m-ou-se commented Jun 5, 2021

Alright. :) Can you open a tracking issue? Thanks!

@glittershark glittershark mentioned this pull request Jun 5, 2021
3 tasks
Add a map method to std::ops::range::Bound, patterned off of the method
of the same name on Option
@glittershark
Copy link
Contributor Author

Alright. :) Can you open a tracking issue? Thanks!

Done! #86026

@m-ou-se
Copy link
Member

m-ou-se commented Jun 5, 2021

Thanks!

@bors r+ rollup

@bors
Copy link
Contributor

bors commented Jun 5, 2021

📌 Commit 223c0d2 has been approved by m-ou-se

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Jun 5, 2021
Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request Jun 5, 2021
Add a map method to Bound

Add a map method to std::ops::range::Bound, patterned off of the method
of the same name on Option.

Have left off creating a tracking issue initially, but as soon as I get the go-ahead from a reviewer I'll make that right away 😄
bors added a commit to rust-lang-ci/rust that referenced this pull request Jun 5, 2021
…laumeGomez

Rollup of 7 pull requests

Successful merges:

 - rust-lang#83646 (Add a map method to Bound)
 - rust-lang#85501 (Fix `deny(invalid_doc_attributes)`)
 - rust-lang#85503 (rustdoc: add tooltips to some buttons)
 - rust-lang#85710 (Document `From` impls in path.rs)
 - rust-lang#85760 (Possible errors when accessing file metadata are platform specific)
 - rust-lang#85974 (td align attribute)
 - rust-lang#86014 (msp430 linker does not accept -znoexecstack. Set linker_is_gnu to fal…)

Failed merges:

 - rust-lang#85972 (Rustdoc html fixes)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 1594076 into rust-lang:master Jun 5, 2021
@rustbot rustbot added this to the 1.54.0 milestone Jun 5, 2021
@glittershark glittershark deleted the bound-map branch June 5, 2021 21:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.