File tree Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Expand file tree Collapse file tree 3 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -8,7 +8,7 @@ Install corofy by entering the `ch8/corofy` folder and
88write ` cargo install --path . ` .
99
1010When that's done you can come back here and make sure that
11- ` src/main.rs ` contains the same code as the ` orignal_main .rs`
11+ ` src/main.rs ` contains the same code as the ` original_main .rs`
1212file does (which is the same as presented in the book).
1313
1414## How to run the example
@@ -67,4 +67,4 @@ fn main() {
6767 thread :: sleep (Duration :: from_millis (100 ));
6868 }
6969}
70- ```
70+ ```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ fn get_path(i: usize) -> String {
1010 format ! ( "/{}/HelloWorld{i}" , i * 1000 )
1111}
1212
13- coro fn async_main ( ) {
13+ coroutine fn async_main ( ) {
1414 println ! ( "Program starting" ) ;
1515
1616 let txt = Http :: get ( & get_path ( 0 ) ) . wait ;
@@ -22,6 +22,7 @@ coro fn async_main() {
2222 let txt = Http :: get ( & get_path ( 3 ) ) . wait ;
2323 println ! ( "{txt}" ) ;
2424 let txt = Http :: get ( & get_path ( 4 ) ) . wait ;
25+ println ! ( "{txt}" ) ;
2526}
2627
2728
@@ -36,4 +37,4 @@ fn main() {
3637 }
3738 }
3839 println ! ( "\n ELAPSED TIME: {}" , start. elapsed( ) . as_secs_f32( ) ) ;
39- }
40+ }
Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ coro fn request(i: usize) {
1212 println ! ( "{txt}" ) ;
1313}
1414
15- coro fn async_main ( ) {
15+ coroutine fn async_main ( ) {
1616 println ! ( "Program starting" ) ;
1717 let mut futures = vec ! [ ] ;
1818
@@ -36,4 +36,4 @@ fn main() {
3636 }
3737
3838 println ! ( "\n ELAPSED TIME: {}" , start. elapsed( ) . as_secs_f32( ) ) ;
39- }
39+ }
You can’t perform that action at this time.
0 commit comments