rust
rust copied to clipboard
Add `Option::transpose_fn` methods
Converts an Option
of an Fn
into an Fn
that returns an Option
.
ACP: https://github.com/rust-lang/libs-team/issues/166 [Accepted]
r? @scottmcm
(rustbot has picked a reviewer for you, use r? to override)
Thanks for the PR! You'll need to file an ACP to get a libs-api second before we add a new unstable API, as described in https://std-dev-guide.rust-lang.org/feature-lifecycle/api-change-proposals.html.
Hey! It looks like you've submitted a new PR for the library teams!
If this PR contains changes to any rust-lang/rust
public library APIs then please comment with @rustbot label +T-libs-api -T-libs
to tag it appropriately. If this PR contains changes to any unstable APIs please edit the PR description to add a link to the relevant API Change Proposal or create one if you haven't already. If you're unsure where your change falls no worries, just leave it as is and the reviewer will take a look and make a decision to forward on if necessary.
Examples of T-libs-api
changes:
- Stabilizing library features
- Introducing insta-stable changes such as new implementations of existing stable traits on existing stable types
- Introducing new or changing existing unstable library APIs (excluding permanently unstable features / features without a tracking issue)
- Changing public documentation in ways that create new stability guarantees
- Changing observable runtime behavior of library APIs
@scottmcm thanks for the heads up! I submitted https://github.com/rust-lang/libs-team/issues/166
:umbrella: The latest upstream changes (presumably #110393) made this pull request unmergeable. Please resolve the merge conflicts.
@nvzqz this acp has been merged so if you can resolve the conflicts we can mark this as ready for review
The ACP wasn't approved because:
...of the many ways in which this transformation can be expressed,
transpose_fn
is the least readable. For example, simple doing|arg| Some(f?(arg))
is much clearer.
I don't feel strongly for or against my proposal so I don't intend to go against the libs API team's opinion.