-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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 flatten for Option<&Option<T>>
and Option<&mut Option<T>>
#108671
base: master
Are you sure you want to change the base?
Conversation
r? @cuviper (rustbot has picked a reviewer for you, use r? to override) |
Hey! It looks like you've submitted a new PR for the library teams! If this PR contains changes to any Examples of
|
Please do create an API Change Proposal as linked above. @rustbot label +T-libs-api -T-libs |
This comment has been minimized.
This comment has been minimized.
r? libs-api |
☔ The latest upstream changes (presumably #130829) made this pull request unmergeable. Please resolve the merge conflicts. |
Submitting this to see if it can be done as a pr or if it needs to be a RFC.
Creates
.flatten_ref()
to get a immutable reference of a nested option and.flatten_mut()
for mutable references. Return type isOption<&T>
as&Option<T>
would require returning a references toNone
which can't be done in constant functions.ACP: rust-lang/libs-team#186