Why no `Future` for ()

Hi, I'm just curious,

why don't we have

impl Future for () {
// ....
}

in https://github.com/rust-lang-nursery/futures-rs/blob/master/futures-core/src/future/mod.rs
?

so we don't need to add Ok(())

Ok(()) is a futures v0.1 thing, and with std::future and async fn you can just write plain'ol semicolon-ending function to get fn() -> impl Future<Output=()>

@Hyeonu
Yeah, you are right.
v0.1 is experimental. async/await is the real thing, just need to wait until v1.37 stable release.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.