Skip to main content

map_none

Macro map_none 

Source
macro_rules! map_none {
    ($option:expr, $variant:ident$(,)? $($arg:ident$(: $value:expr)?),*) => { ... };
}
Expand description

Converts None into an error variant without returning early.

map_none should be used only when the error variant doesn’t capture any owned variables (which is very rare), or exactly at the end of the block (in the position of returned expression).