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 66// option. This file may not be copied, modified, or distributed
77// except according to those terms.
88
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;
1013
1114use trait_transformer:: trait_transformer;
1215
@@ -18,27 +21,28 @@ trait IntFactory {
1821 fn call ( & self ) -> u32 ;
1922}
2023
21- fn thing ( factory : impl SendIntFactory ) {
22- tokio:: task:: spawn ( || async {
24+ fn thing ( factory : impl SendIntFactory + ' static ) {
25+ tokio:: task:: spawn ( async move {
2326 factory. make ( ) . await ;
24- } )
27+ } ) ;
2528}
2629
2730struct MyFactory ;
2831
2932impl IntFactory for MyFactory {
3033 async fn make ( & self ) -> i32 {
31- todo ! ( ) ;
34+ todo ! ( )
3235 }
3336
3437 fn stream ( & self ) -> impl Iterator < Item = i32 > {
35- todo ! ( ) ;
38+ iter :: empty ( )
3639 }
3740
3841 fn call ( & self ) -> u32 {
3942 0
4043 }
4144}
45+ impl SendIntFactory for MyFactory { }
4246
4347fn main ( ) {
4448 let my_factory = MyFactory ;
You can’t perform that action at this time.
0 commit comments