cargo-deb 2.0.2

Make Debian packages (.deb) easily with a Cargo subcommand
Documentation
use crate::error::CDResult;

pub trait OkOrThen<T> {
    fn ok_or_then<F: FnOnce() -> CDResult<T>>(self, cb: F) -> CDResult<T>;
}

impl<T> OkOrThen<T> for Option<T> {
    fn ok_or_then<F: FnOnce() -> CDResult<T>>(self, cb: F) -> CDResult<T> {
        if let Some(s) = self {
            Ok(s)
        } else {
            cb()
        }
    }
}