must_future

Crates.iomust_future
lib.rsmust_future
version0.1.2
sourcesrc
created_at2020-04-03 23:20:15.841426
updated_at2020-06-11 14:51:18.385816
descriptionA wrapper future marked must_use - mainly to wrap BoxFutures
homepage
repositoryhttps://github.com/neonphog/must_future
max_upload_size
id226086
size20,623
David Braden (neonphog)

documentation

https://docs.rs/must_future

README

Crates.io Crates.io

must_future

BoxFutures cannot be marked #[must_use] because they are just type definitions. This newtype struct wraps a BoxFuture with something that can be marked #[must_use].

Will Not Compile:

#![deny(unused_must_use)]

use futures::future::FutureExt;

#[tokio::main]
async fn main() {
    fn get_future() -> must_future::MustBoxFuture<'static, ()> {
        async { }.boxed().into()
    }

    get_future(); // unused `must_future::MustBoxFuture` that must be used
}
Commit count: 5

cargo fmt