/// Applies a given binary operation, `op`, to two references to `Option<Bitmap>`'s.
///
/// This function is useful when implementing operations on higher level arrays.
Applies a given binary operation, `op`, to two references to `Option`'s.
This function is useful when implementing operations on higher level arrays.
Applies a given binary operation ` op ` to two references to ` Option ` ' s . This function is useful when implementing operations on higher level arrays .
pub(super) fn apply_bin_op_to_option_bitmap<F>(
    left: &Option<Bitmap>,
    right: &Option<Bitmap>,
    op: F,
) -> Result<Option<Buffer>>
where
    F: Fn(&Buffer, &Buffer) -> Result<Buffer>,
{
    match *left {
        None => match *right {
            None => Ok(None),
            Some(ref r) => Ok(Some(r.buffer_ref().clone())),
        },
        Some(ref l) => match *right {
            None => Ok(Some(l.buffer_ref().clone())),
            Some(ref r) => Ok(Some(op(&l.buffer_ref(), &r.buffer_ref())?)),
        },
    }
}
pub ( super ) fn apply_bin_op_to_option_bitmap < F > ( left : & Option < Bitmap > , right : & Option < Bitmap > , op : F , ) -> Result < Option < Buffer > > where F : Fn ( & Buffer , & Buffer ) -> Result < Buffer > , { match * left { None => match * right { None => Ok ( None ) , Some ( ref r ) => Ok ( Some ( r . buffer_ref ( ) . clone ( ) ) ) , } , Some ( ref l ) => match * right { None => Ok ( Some ( l . buffer_ref ( ) . clone ( ) ) ) , Some ( ref r ) => Ok ( Some ( op ( & l . buffer_ref ( ) , & r . buffer_ref ( ) ) ? ) ) , } , } }
Applies a given binary operation, `op`, to two references to `Option<Bitmap>`'s.
Applies a given binary operation ` op ` to two references to ` Option<Bitmap > ` ' s .
left
&Option<Bitmap>
right
&Option<Bitmap>
op
F