aboutsummaryrefslogtreecommitdiff
path: root/src/test_utils.rs
diff options
context:
space:
mode:
authorHampusM <hampus@hampusmat.com>2023-08-04 15:24:32 +0200
committerHampusM <hampus@hampusmat.com>2023-08-04 15:25:58 +0200
commit14e45fe9aa2431120cfd6a7240f8bb94e45e730d (patch)
tree72bceb0580801ec1d59fc7f79e609f0ac7c53681 /src/test_utils.rs
parentdce6bfc2321c0041fef5a2cb368ff45ba089198b (diff)
refactor!: remove async_closure macro from API
BREAKING CHANGE: The async_closure macro has been removed. This is because it is completely out of scope for this crate
Diffstat (limited to 'src/test_utils.rs')
-rw-r--r--src/test_utils.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/src/test_utils.rs b/src/test_utils.rs
index 6fba778..8f07fa9 100644
--- a/src/test_utils.rs
+++ b/src/test_utils.rs
@@ -536,3 +536,20 @@ pub mod mocks
impl crate::dependency_history::private::Sealed for DependencyHistory {}
}
}
+
+#[cfg(feature = "async")]
+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)* })
+ })
+ };
+}
+
+#[cfg(feature = "async")]
+pub(crate) use async_closure;