mirror of
https://github.com/fluencelabs/rust-libp2p
synced 2025-06-14 18:41:22 +00:00
add must_use for Future (#450)
This commit is contained in:
committed by
Toralf Wittner
parent
02576eecf1
commit
ee9be6f0c9
@ -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),
|
||||
|
Reference in New Issue
Block a user