From 6f1a87097e7855df96948005eb3db87689b51fa2 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Mon, 24 Jul 2017 10:11:29 -0700 Subject: [PATCH] style(lib): add must_use attributes to futures and streams --- src/client/connect.rs | 1 + src/client/mod.rs | 1 + src/http/body.rs | 1 + 3 files changed, 3 insertions(+) diff --git a/src/client/connect.rs b/src/client/connect.rs index 716e2f94..5420bdf7 100644 --- a/src/client/connect.rs +++ b/src/client/connect.rs @@ -147,6 +147,7 @@ impl StdError for InvalidUrl { } /// A Future representing work to connect to a URL. +#[must_use = "futures do nothing unless polled"] pub struct HttpConnecting { state: State, handle: Handle, diff --git a/src/client/mod.rs b/src/client/mod.rs index cf27367f..87594785 100644 --- a/src/client/mod.rs +++ b/src/client/mod.rs @@ -110,6 +110,7 @@ where C: Connect, } /// A `Future` that will resolve to an HTTP Response. +#[must_use = "futures do nothing unless polled"] pub struct FutureResponse(Box + 'static>); impl fmt::Debug for FutureResponse { diff --git a/src/http/body.rs b/src/http/body.rs index e9b61997..aab1d90a 100644 --- a/src/http/body.rs +++ b/src/http/body.rs @@ -8,6 +8,7 @@ use http::Chunk; pub type TokioBody = tokio_proto::streaming::Body; /// A `Stream` for `Chunk`s used in requests and responses. +#[must_use = "streams do nothing unless polled"] #[derive(Debug)] pub struct Body(TokioBody);