[โ€“] 19 points 6 months ago*

You are running into the Send Approximation being too conservative. The compiler does not like to see a let binding for a non-Send type and an .await statement in the same scope. It is not (yet) smart enough to know that the non-Send type is already consumed by the time of the .await.

You've already discovered the workaround in your three(). To make it more concise

async fn four() {
    let content = do_stuff().err().map(|err| err.to_string());
    if let Some(content) = content {
        let _ = do_stuff_2(content).await;
    }
}
  • source
  • [โ€“] 27 points 1 year ago (33 children)

    Does any GNOME user here use X11? On my computer I have been exclusively using Wayland for 3 years. It's great.

    Slightly concerned about remote desktopping though. What do I replace xrdp with?

  • source