mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-28 00:00:11 +02:00
Merge pull request #272 from cramertj/must-use
Set Future types as must_use
This commit is contained in:
@@ -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),
|
||||
|
||||
Reference in New Issue
Block a user