add must_use for Future (#450)

This commit is contained in:
Guanqun Lu
2018-09-04 18:30:57 +08:00
committed by Toralf Wittner
parent 02576eecf1
commit ee9be6f0c9
11 changed files with 14 additions and 0 deletions

View File

@ -213,6 +213,7 @@ where
}
#[derive(Debug, Copy, Clone)]
#[must_use = "futures do nothing unless polled"]
pub enum EitherOutbound<A: StreamMuxer, B: StreamMuxer> {
A(A::OutboundSubstream),
B(B::OutboundSubstream),
@ -220,6 +221,7 @@ pub enum EitherOutbound<A: StreamMuxer, B: StreamMuxer> {
/// Implements `Stream` and dispatches all method calls to either `First` or `Second`.
#[derive(Debug, Copy, Clone)]
#[must_use = "futures do nothing unless polled"]
pub enum EitherListenStream<A, B> {
First(A),
Second(B),
@ -248,6 +250,7 @@ where
// If Rust had impl Trait we could use the Either enum from the futures crate and add some
// modifiers to it. This custom enum is a combination of Either and these modifiers.
#[derive(Debug, Copy, Clone)]
#[must_use = "futures do nothing unless polled"]
pub enum EitherListenUpgrade<A, B> {
First(A),
Second(B),