mirror of
https://github.com/fafhrd91/actix-net
synced 2025-06-26 15:07:43 +02:00
macros: Add actix-reexport
feature (#218)
This commit is contained in:
@ -1,5 +1,9 @@
|
||||
# CHANGES
|
||||
|
||||
## 0.1.3 - 2020-12-
|
||||
|
||||
* Add `actix-reexport` feature
|
||||
|
||||
## 0.1.2 - 2020-05-18
|
||||
|
||||
### Changed
|
||||
|
@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "actix-macros"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
authors = ["Nikolay Kim <fafhrd91@gmail.com>"]
|
||||
description = "Actix runtime macros"
|
||||
repository = "https://github.com/actix/actix-net"
|
||||
@ -16,6 +16,9 @@ proc-macro = true
|
||||
quote = "1.0.3"
|
||||
syn = { version = "^1", features = ["full"] }
|
||||
|
||||
[features]
|
||||
actix-reexport = []
|
||||
|
||||
[dev-dependencies]
|
||||
actix-rt = "1.0"
|
||||
|
||||
|
@ -33,14 +33,25 @@ pub fn main(_: TokenStream, item: TokenStream) -> TokenStream {
|
||||
|
||||
sig.asyncness = None;
|
||||
|
||||
(quote! {
|
||||
#(#attrs)*
|
||||
#vis #sig {
|
||||
actix_rt::System::new(stringify!(#name))
|
||||
.block_on(async move { #body })
|
||||
}
|
||||
})
|
||||
.into()
|
||||
if cfg!(feature = "actix-reexport") {
|
||||
(quote! {
|
||||
#(#attrs)*
|
||||
#vis #sig {
|
||||
actix::System::new(stringify!(#name))
|
||||
.block_on(async move { #body })
|
||||
}
|
||||
})
|
||||
.into()
|
||||
} else {
|
||||
(quote! {
|
||||
#(#attrs)*
|
||||
#vis #sig {
|
||||
actix_rt::System::new(stringify!(#name))
|
||||
.block_on(async move { #body })
|
||||
}
|
||||
})
|
||||
.into()
|
||||
}
|
||||
}
|
||||
|
||||
/// Marks async test function to be executed by actix runtime.
|
||||
|
Reference in New Issue
Block a user