genawaiter
This crate lets you use generators on stable Rust. Instead of using yield
, which won't be stabilized anytime soon, you use async
/await
, which is stable today:
use ;
async
for n in new
Result:
1
3
5
7
9
See the docs for more.