fasterthanlime / feedback

An issue tracker for articles/series/videos at https://fasterthanli.me/
13 stars 0 forks source link

Understanding Rust futures by going way too deep #290

Closed kbridge closed 9 months ago

kbridge commented 9 months ago

I found something wrong on this page:

https://fasterthanli.me/articles/understanding-rust-futures-by-going-way-too-deep#position=79.0

Here's what it is:

I suggest prepending the following use statements

use std::time::Duration;
use tokio::time::sleep;

to the code block

    info!("Joining...");
    let res = tj::try_join(
        async move {
            sleep(Duration::from_millis(2000)).await;
            Ok(())
        },
        async move {
            sleep(Duration::from_millis(10)).await;
            Err::<(), Report>(color_eyre::eyre::eyre!("uh oh"))
        },
    )
    .await;
fasterthanlime commented 9 months ago

Good idea, I've done that!