mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-08-25 00:00:18 +02:00
Set Future types as must_use
This commit is contained in:
@@ -235,10 +235,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),
|
||||
|
||||
@@ -394,6 +394,7 @@ impl fmt::Debug for UdpSocket {
|
||||
/// A future used to write the entire contents of some data to a UDP socket.
|
||||
///
|
||||
/// This is created by the `UdpSocket::send_dgram` method.
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
pub struct SendDgram<T> {
|
||||
state: SendState<T>,
|
||||
}
|
||||
@@ -441,6 +442,7 @@ impl<T> Future for SendDgram<T>
|
||||
/// A future used to receive a datagram from a UDP socket.
|
||||
///
|
||||
/// This is created by the `UdpSocket::recv_dgram` method.
|
||||
#[must_use = "futures do nothing unless polled"]
|
||||
pub struct RecvDgram<T> {
|
||||
state: RecvState<T>,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user