Skip to content

corofy related fixes #2

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions ch07/b-async-await/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Install corofy by entering the `ch8/corofy` folder and
write `cargo install --path .`.

When that's done you can come back here and make sure that
`src/main.rs` contains the same code as the `orignal_main.rs`
`src/main.rs` contains the same code as the `original_main.rs`
file does (which is the same as presented in the book).

## How to run the example
Expand Down Expand Up @@ -67,4 +67,4 @@ fn main() {
thread::sleep(Duration::from_millis(100));
}
}
```
```
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ fn get_path(i: usize) -> String {
format!("/{}/HelloWorld{i}", i * 1000)
}

coro fn async_main() {
coroutine fn async_main() {
println!("Program starting");

let txt = Http::get(&get_path(0)).wait;
Expand All @@ -22,6 +22,7 @@ coro fn async_main() {
let txt = Http::get(&get_path(3)).wait;
println!("{txt}");
let txt = Http::get(&get_path(4)).wait;
println!("{txt}");
}


Expand All @@ -36,4 +37,4 @@ fn main() {
}
}
println!("\nELAPSED TIME: {}", start.elapsed().as_secs_f32());
}
}
4 changes: 2 additions & 2 deletions ch07/c-async-await/original_main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ coro fn request(i: usize) {
println!("{txt}");
}

coro fn async_main() {
coroutine fn async_main() {
println!("Program starting");
let mut futures = vec![];

Expand All @@ -36,4 +36,4 @@ fn main() {
}

println!("\nELAPSED TIME: {}", start.elapsed().as_secs_f32());
}
}