File tree 1 file changed +5
-10
lines changed 1 file changed +5
-10
lines changed Original file line number Diff line number Diff line change @@ -143,16 +143,13 @@ pub fn test(_attr: TokenStream, item: TokenStream) -> TokenStream {
143
143
///
144
144
/// ```ignore
145
145
/// #![feature(test)]
146
- ///
147
146
/// extern crate test;
148
147
///
149
- /// use async_std::task;
150
- ///
151
- /// #[async_attributes::test]
152
- /// async fn spawn_and_await() {
153
- /// task::spawn(async {
148
+ /// #[async_attributes::bench]
149
+ /// async fn bench_1(b: &mut test::Bencher) {
150
+ /// b.iter(|| {
154
151
/// println!("hello world");
155
- /// }).await;
152
+ /// })
156
153
/// }
157
154
/// ```
158
155
#[ proc_macro_attribute]
@@ -182,9 +179,7 @@ pub fn bench(_attr: TokenStream, item: TokenStream) -> TokenStream {
182
179
#( #attrs) *
183
180
fn #name( b: & mut test:: Bencher ) #ret {
184
181
task:: block_on( task:: spawn( async {
185
- b. iter( || {
186
- #body
187
- } )
182
+ #body
188
183
} ) )
189
184
}
190
185
} ;
You can’t perform that action at this time.
0 commit comments