pub fn result_or_error<T, E, M>(res: Result<T, E>, exit_code: i32, msg: M) -> T 
    where E: Error + Debug,
          M: Display {
    match res {
        Ok(res)  => res,
        Err(err) => error(err, exit_code, msg)
    }
}
/// Unwrap a given result or exit the process printing the error.
Unwrap a given result or exit the process printing the error.
Unwrap a given result or exit the process printing the error .
pub fn result_or_error<T, E, M>(res: Result<T, E>, exit_code: i32, msg: M) -> T 
    where E: Error + Debug,
          M: Display {
    match res {
        Ok(res)  => res,
        Err(err) => error(err, exit_code, msg)
    }
}
pub fn result_or_error < T , E , M > ( res : Result < T , E > , exit_code : i32 , msg : M ) -> T where E : Error + Debug , M : Display { match res { Ok ( res ) => res , Err ( err ) => error ( err , exit_code , msg ) } }
Unwrap a given result or exit the process printing the error.
Unwrap a given result or exit the process printing the error .
res
Result<T, E>
exit_code
i32
msg
M
res
Result<T, E>
exit_code
i32
msg
M