Feature gate: #![feature(option_reference_flattening)]
This is a tracking issue for rust-lang/libs-team#186
This feature lets users of nested referenced options be able to conveniently flatten them into a single option.
Public API
// core::option
impl<'a, T> Option<&'a Option<T>> {
const fn flatten_ref(self) -> Option<&'a T>;
}
impl<'a, T> Option<&'a mut Option<T>> {
const fn flatten_ref(self) -> Option<&'a T>;
const fn flatten_mut(self) -> Option<&'a mut T> {
}
Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
Unresolved Questions
Feature gate:
#![feature(option_reference_flattening)]This is a tracking issue for rust-lang/libs-team#186
This feature lets users of nested referenced options be able to conveniently flatten them into a single option.
Public API
Steps / History
(Remember to update the
S-tracking-*label when checking boxes.)Option<&Option<T>>andOption<&mut Option<T>>libs-team#186Option<&Option<T>>andOption<&mut Option<T>>#108671Unresolved Questions
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩