Merge pull request #272 from cramertj/must-use

Set Future types as must_use
This commit is contained in:
Alex Crichton
2017-10-27 12:19:21 -04:00
committed by GitHub
14 changed files with 18 additions and 0 deletions
+3
View File
@@ -25,6 +25,7 @@ pub struct TcpListener {
/// Stream returned by the `TcpListener::incoming` function representing the
/// stream of sockets received from a listener.
#[must_use = "streams do nothing unless polled"]
pub struct Incoming {
inner: TcpListener,
}
@@ -235,10 +236,12 @@ pub struct TcpStream {
/// Future returned by `TcpStream::connect` which will resolve to a `TcpStream`
/// when the stream is connected.
#[must_use = "futures do nothing unless polled"]
pub struct TcpStreamNew {
inner: TcpStreamNewState,
}
#[must_use = "futures do nothing unless polled"]
enum TcpStreamNewState {
Waiting(TcpStream),
Error(io::Error),