2022-06-08 19:16:12 +00:00
|
|
|
/// Return value or error (if None) from Some(T)
|
2022-04-19 19:10:36 +00:00
|
|
|
#[macro_export]
|
|
|
|
macro_rules! option_return {
|
2022-04-19 19:18:45 +00:00
|
|
|
($variable:expr,$err_desc:expr) => {
|
|
|
|
$variable.ok_or(std::io::Error::new(std::io::ErrorKind::Other, $err_desc))
|
2022-04-19 19:10:36 +00:00
|
|
|
};
|
|
|
|
}
|