style(lib): add must_use attributes to futures and streams
This commit is contained in:
@@ -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,
|
||||||
|
|||||||
@@ -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 {
|
||||||
|
|||||||
@@ -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);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user