Trait mcoffin_option_ext::OptionExtDefault[][src]

pub trait OptionExtDefault<T> {
    fn or_default(self) -> T;
}

Extensions for Option<T> where T: Default

Required methods

fn or_default(self) -> T[src]

If self is Some(v), returns v, otherwise returns Default::default()

Loading content...

Implementations on Foreign Types

impl<T> OptionExtDefault<T> for Option<T> where
    T: Default
[src]

impl<T, E> OptionExtDefault<T> for Result<T, E> where
    T: Default
[src]

Loading content...

Implementors

Loading content...