Getting started with futures

What is wrong with the way I am trying to using the join! macro in the code at the link at the bottom?
The error is "(std::result::Result<f64, std::io::Error>, std::result::Result<f64, std::io::Error>) is not a future". But what I'm doing seems to match what I see in this blog:

in the line join!(first_sleeper(), second_sleeper());

The join macro returns an ordinary tuple, not a Future, so you shouldn't .await it. If you remove the .await it should work.

1 Like
let (sum1, sum2) = join!(compute1(), compute2());
println!("sum1 = {:?}, sum2 = {:?}", sum1, sum2);
1 Like