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
8
8
write ` cargo install --path . ` .
9
9
10
10
When 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`
12
12
file does (which is the same as presented in the book).
13
13
14
14
## How to run the example
@@ -67,4 +67,4 @@ fn main() {
67
67
thread :: sleep (Duration :: from_millis (100 ));
68
68
}
69
69
}
70
- ```
70
+ ```
Original file line number Diff line number Diff line change @@ -10,7 +10,7 @@ fn get_path(i: usize) -> String {
10
10
format ! ( "/{}/HelloWorld{i}" , i * 1000 )
11
11
}
12
12
13
- coro fn async_main ( ) {
13
+ coroutine fn async_main ( ) {
14
14
println ! ( "Program starting" ) ;
15
15
16
16
let txt = Http :: get ( & get_path ( 0 ) ) . wait ;
@@ -22,6 +22,7 @@ coro fn async_main() {
22
22
let txt = Http :: get ( & get_path ( 3 ) ) . wait ;
23
23
println ! ( "{txt}" ) ;
24
24
let txt = Http :: get ( & get_path ( 4 ) ) . wait ;
25
+ println ! ( "{txt}" ) ;
25
26
}
26
27
27
28
@@ -36,4 +37,4 @@ fn main() {
36
37
}
37
38
}
38
39
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) {
12
12
println ! ( "{txt}" ) ;
13
13
}
14
14
15
- coro fn async_main ( ) {
15
+ coroutine fn async_main ( ) {
16
16
println ! ( "Program starting" ) ;
17
17
let mut futures = vec ! [ ] ;
18
18
@@ -36,4 +36,4 @@ fn main() {
36
36
}
37
37
38
38
println ! ( "\n ELAPSED TIME: {}" , start. elapsed( ) . as_secs_f32( ) ) ;
39
- }
39
+ }
You can’t perform that action at this time.
0 commit comments