Skip to content

Commit

Permalink
style(lib): add must_use attributes to futures and streams
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Jul 24, 2017
1 parent 9b47e18 commit 6f1a870
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/client/connect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
1 change: 1 addition & 0 deletions src/client/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Future<Item=Response, Error=::Error> + 'static>);

impl fmt::Debug for FutureResponse {
Expand Down
1 change: 1 addition & 0 deletions src/http/body.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ use http::Chunk;
pub type TokioBody = tokio_proto::streaming::Body<Chunk, ::Error>;

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

Expand Down

0 comments on commit 6f1a870

Please sign in to comment.