Skip to main content

extern_spec_T_Option_T_unwrap_or_else

Function extern_spec_T_Option_T_unwrap_or_else 

Source
pub fn extern_spec_T_Option_T_unwrap_or_else<T, F>(self_: Option<T>, f: F) -> T
where F: FnOnce() -> T,
Expand description

extern spec for Option<T>::unwrap_or_else

This is not a real function: its only use is for documentation.

requires

self == None ==> f.precondition(())

ensures

match self {
    None => f.postcondition_once((), result),
    Some(t) => result == t
}