Skip to content

Commit a98669b

Browse files
committed
revert #7
Signed-off-by: Yoshua Wuyts <[email protected]>
1 parent dad72fc commit a98669b

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

src/lib.rs

+4-6
Original file line numberDiff line numberDiff line change
@@ -147,9 +147,7 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream {
147147
///
148148
/// #[async_attributes::bench]
149149
/// async fn bench_1(b: &mut test::Bencher) {
150-
/// b.iter(|| {
151-
/// println!("hello world");
152-
/// })
150+
/// println!("hello world");
153151
/// }
154152
/// ```
155153
#[proc_macro_attribute]
@@ -178,9 +176,9 @@ pub fn bench(_attr: TokenStream, item: TokenStream) -> TokenStream {
178176
#[bench]
179177
#(#attrs)*
180178
fn #name(b: &mut test::Bencher) #ret {
181-
task::block_on(task::spawn(async {
182-
#body
183-
}))
179+
b.iter(|| {
180+
let _ = async_std::task::block_on(async { #body });
181+
});
184182
}
185183
};
186184

0 commit comments

Comments
 (0)