Skip to content

Instantly share code, notes, and snippets.

@fenhl
Created July 12, 2019 12:58
Show Gist options
  • Save fenhl/0e56173045c23a7b471119a12e348312 to your computer and use it in GitHub Desktop.
Save fenhl/0e56173045c23a7b471119a12e348312 to your computer and use it in GitHub Desktop.
tokio::main problem minimal example
[package]
name = "tokio-main"
version = "0.1.0"
authors = ["Fenhl <[email protected]>"]
edition = "2018"
[[bin]]
name = "tokio-main"
path = "src/main.rs"
[dependencies.futures-preview]
version = "0.3.0-alpha.16"
[dependencies.tokio]
git = "https://github.com/tokio-rs/tokio"
rev = "22918231814fb5591a4c0c6d5aa0c5ba8172c9c1"
#![feature(async_await)]
use {
std::pin::Pin,
futures::prelude::*
};
fn stream() -> Pin<Box<dyn Stream<Item = ()>>> {
stream::repeat(()).boxed()
}
#[tokio::main]
async fn main() {
let mut stream = stream();
stream.next().await;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment