/// Applies a function to the contained value (if any), or returns the provided default (if not).
/// Arguments passed to map_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use map_or_else, which is lazily evaluated.
///
/// ```rust
/// use galbi::*;
///
/// let x = OptionBox::some(10);
/// assert_eq!(x.map_or(111, |e| *e), 10);
///
/// let x: OptionBox<i32> = OptionBox::none();
/// assert_eq!(x.map_or(10, |e| *e), 10);
/// ```
Applies a function to the contained value (if any), or returns the provided default (if not).
Arguments passed to map_or are eagerly evaluated; if you are passing the result of a function call, it is recommended to use map_or_else, which is lazily evaluated.






Applies a function to the contained value ( if any ) or returns the provided default ( if not ) . Arguments passed to map_or are eagerly evaluated ; if you are passing the result of a function call it is recommended to use map_or_else which is lazily evaluated .
pub fn map_or<U, F>(self, default: U, f: F) -> U
    where
        F: FnOnce(Box<T>) -> U,
    {
        self.ptr.map_or(default, f)
    }
pub fn map_or < U , F > ( self , default : U , f : F ) -> U where F : FnOnce ( Box < T > ) -> U , { self . ptr . map_or ( default , f ) }
Applies a function to the contained value (if any), or returns the provided default (if not).
Applies a function to the contained value ( if any ) or returns the provided default ( if not ) .
self
default
U
f
F