Skip to content

simplification for async slides#396

Open
robamu wants to merge 2 commits into
mainfrom
simplify-async-slides
Open

simplification for async slides#396
robamu wants to merge 2 commits into
mainfrom
simplify-async-slides

Conversation

@robamu

@robamu robamu commented Jul 3, 2026

Copy link
Copy Markdown
Contributor

No description provided.

@robamu robamu requested a review from jonathanpallant July 3, 2026 15:13
@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Jul 3, 2026

Copy link
Copy Markdown

Deploying ferrous-systems-rust-training with  Cloudflare Pages  Cloudflare Pages

Latest commit: d6aa44f
Status: ✅  Deploy successful!
Preview URL: https://1e3b3f9f.ferrous-systems-rust-training.pages.dev
Branch Preview URL: https://simplify-async-slides.ferrous-systems-rust-training.pages.dev

View logs

}
.await;
// By awaiting, we are actually executing the code asynchronously.
let read_from_disk_future = read_from_disk("Cargo.toml").await;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
let read_from_disk_future = read_from_disk("Cargo.toml").await;
let read_from_disk_future = read_from_disk();
let result = read_from_disk_future.await;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we should keep this as two lines, so we can see that one makes the future, and one causes the future to run, blocking this function until the future has completed.


```rust [], ignore
fn main() {
// This code will not start reading from the disk by its own!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// This code will not start reading from the disk by its own!
// This code will not start reading from the disk on its own!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants