style(lib): add must_use attributes to futures and streams

This commit is contained in:
Sean McArthur
2017-07-24 10:11:29 -07:00
parent 9b47e1861a
commit 6f1a87097e
3 changed files with 3 additions and 0 deletions

View File

@@ -147,6 +147,7 @@ impl StdError for InvalidUrl {
} }
/// A Future representing work to connect to a URL. /// A Future representing work to connect to a URL.
#[must_use = "futures do nothing unless polled"]
pub struct HttpConnecting { pub struct HttpConnecting {
state: State, state: State,
handle: Handle, handle: Handle,

View File

@@ -110,6 +110,7 @@ where C: Connect,
} }
/// A `Future` that will resolve to an HTTP Response. /// A `Future` that will resolve to an HTTP Response.
#[must_use = "futures do nothing unless polled"]
pub struct FutureResponse(Box<Future<Item=Response, Error=::Error> + 'static>); pub struct FutureResponse(Box<Future<Item=Response, Error=::Error> + 'static>);
impl fmt::Debug for FutureResponse { impl fmt::Debug for FutureResponse {

View File

@@ -8,6 +8,7 @@ use http::Chunk;
pub type TokioBody = tokio_proto::streaming::Body<Chunk, ::Error>; pub type TokioBody = tokio_proto::streaming::Body<Chunk, ::Error>;
/// A `Stream` for `Chunk`s used in requests and responses. /// A `Stream` for `Chunk`s used in requests and responses.
#[must_use = "streams do nothing unless polled"]
#[derive(Debug)] #[derive(Debug)]
pub struct Body(TokioBody); pub struct Body(TokioBody);