Skip to content

Commit b91be89

Browse files
authored
Merge pull request PacktPublishing#2 from joseluis/joseluis-patch-1
corofy related fixes
2 parents 2db96fa + 0f6da9b commit b91be89

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

ch07/b-async-await/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ Install corofy by entering the `ch8/corofy` folder and
88
write `cargo install --path .`.
99

1010
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`
1212
file 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+
```

ch07/b-async-await/orignial_main.rs renamed to ch07/b-async-await/original_main.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff 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!("\nELAPSED TIME: {}", start.elapsed().as_secs_f32());
39-
}
40+
}

ch07/c-async-await/original_main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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!("\nELAPSED TIME: {}", start.elapsed().as_secs_f32());
39-
}
39+
}

0 commit comments

Comments
 (0)