mirror of
https://gitlab.com/pulsechaincom/lighthouse-pulse.git
synced 2025-01-15 16:38:20 +00:00
14 lines
351 B
Rust
14 lines
351 B
Rust
|
macro_rules! try_future {
|
||
|
($expr:expr) => {
|
||
|
match $expr {
|
||
|
core::result::Result::Ok(val) => val,
|
||
|
core::result::Result::Err(err) => {
|
||
|
return Box::new(futures::future::err(std::convert::From::from(err)))
|
||
|
}
|
||
|
}
|
||
|
};
|
||
|
($expr:expr,) => {
|
||
|
$crate::try_future!($expr)
|
||
|
};
|
||
|
}
|