Skip to main content

some

Macro some 

Source
macro_rules! some {
    ($result:expr) => { ... };
}
Expand description

Check if an expression is Some

This is a convienence macro to achieve a similar effect of ? on an option, in a function that returns Result<Option<T>>

Effectively expands to

match <expr> {
    Some(x) => x,
    None => return Ok(None),
}