Skip to content

Commit 6f1a870

Browse files
committed
style(lib): add must_use attributes to futures and streams
1 parent 9b47e18 commit 6f1a870

File tree

3 files changed

+3
-0
lines changed

3 files changed

+3
-0
lines changed

src/client/connect.rs

+1
Original file line numberDiff line numberDiff line change
@@ -147,6 +147,7 @@ impl StdError for InvalidUrl {
147147
}
148148

149149
/// A Future representing work to connect to a URL.
150+
#[must_use = "futures do nothing unless polled"]
150151
pub struct HttpConnecting {
151152
state: State,
152153
handle: Handle,

src/client/mod.rs

+1
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ where C: Connect,
110110
}
111111

112112
/// A `Future` that will resolve to an HTTP Response.
113+
#[must_use = "futures do nothing unless polled"]
113114
pub struct FutureResponse(Box<Future<Item=Response, Error=::Error> + 'static>);
114115

115116
impl fmt::Debug for FutureResponse {

src/http/body.rs

+1
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use http::Chunk;
88
pub type TokioBody = tokio_proto::streaming::Body<Chunk, ::Error>;
99

1010
/// A `Stream` for `Chunk`s used in requests and responses.
11+
#[must_use = "streams do nothing unless polled"]
1112
#[derive(Debug)]
1213
pub struct Body(TokioBody);
1314

0 commit comments

Comments
 (0)