Tracking Issue for option_reference_flattening (original) (raw)

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> { const fn flatten_ref(self) -> Option<&'a T>; }

impl<'a, T> Option<&'a mut Option> { 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

Footnotes

  1. https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html