Macro konst::option::flatten

source ·
macro_rules! flatten {
    ($opt:expr $(,)? ) => { ... };
}
Expand description

A const equivalent of Option::flatten

§Example

use konst::option;

const ARR: &[Option<u32>] = &[
    option::flatten!(Some(Some(8))),
    option::flatten!(None),
];

assert_eq!(ARR, &[Some(8), None]);