File tree Expand file tree Collapse file tree 1 file changed +10
-6
lines changed
trait_transformer/examples Expand file tree Collapse file tree 1 file changed +10
-6
lines changed Original file line number Diff line number Diff line change 6
6
// option. This file may not be copied, modified, or distributed
7
7
// except according to those terms.
8
8
9
- #![ feature( async_fn_in_trait, return_position_impl_trait_in_trait, return_type_notation) ]
9
+ #![ allow( incomplete_features) ]
10
+ #![ feature( return_type_notation) ]
11
+
12
+ use std:: iter;
10
13
11
14
use trait_transformer:: trait_transformer;
12
15
@@ -18,27 +21,28 @@ trait IntFactory {
18
21
fn call ( & self ) -> u32 ;
19
22
}
20
23
21
- fn thing ( factory : impl SendIntFactory ) {
22
- tokio:: task:: spawn ( || async {
24
+ fn thing ( factory : impl SendIntFactory + ' static ) {
25
+ tokio:: task:: spawn ( async move {
23
26
factory. make ( ) . await ;
24
- } )
27
+ } ) ;
25
28
}
26
29
27
30
struct MyFactory ;
28
31
29
32
impl IntFactory for MyFactory {
30
33
async fn make ( & self ) -> i32 {
31
- todo ! ( ) ;
34
+ todo ! ( )
32
35
}
33
36
34
37
fn stream ( & self ) -> impl Iterator < Item = i32 > {
35
- todo ! ( ) ;
38
+ iter :: empty ( )
36
39
}
37
40
38
41
fn call ( & self ) -> u32 {
39
42
0
40
43
}
41
44
}
45
+ impl SendIntFactory for MyFactory { }
42
46
43
47
fn main ( ) {
44
48
let my_factory = MyFactory ;
You can’t perform that action at this time.
0 commit comments