diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 53 | 
1 files changed, 0 insertions, 53 deletions
@@ -160,56 +160,3 @@ macro_rules! di_container_bind {          syrette::declare_interface!($implementation -> $interface);      };  } - -/// Creates a async closure. -/// -/// # Examples -/// ``` -/// # use syrette::async_closure; -/// # -/// # async fn do_heavy_operation(timeout: u32, size: u32) -> String { String::new() } -/// # -/// # async fn do_other_heavy_operation(input: String) -> String { String::new() } -/// # -/// async_closure!(|timeout, size| { -///     let value = do_heavy_operation(timeout, size).await; -/// -///     let final_value = do_other_heavy_operation(value).await; -/// -///     final_value -/// }); -/// ``` -/// -/// expands to the following -/// -/// ```rust -/// # async fn do_heavy_operation(timeout: u32, size: u32) -> String { String::new() } -/// # -/// # async fn do_other_heavy_operation(input: String) -> String { String::new() } -/// # -/// Box::new(|timeout, size| { -///     Box::pin(async move { -///         let value = do_heavy_operation(timeout, size).await; -/// -///         let final_value = do_other_heavy_operation(value).await; -/// -///         final_value -///     }) -/// }); -/// ``` -#[cfg(feature = "async")] -#[cfg_attr(doc_cfg, doc(cfg(feature = "async")))] -#[cfg(not(tarpaulin_include))] -#[macro_export] -macro_rules! async_closure { -    (|$($args: ident),*| { $($inner: stmt);* }) => { -        Box::new(|$($args),*| { -            Box::pin(async move { $($inner)* }) -        }) -    }; -    (|| { $($inner: stmt);* }) => { -        Box::new(|| { -            Box::pin(async move { $($inner)* }) -        }) -    }; -}  | 
