Last active
February 8, 2020 16:32
-
-
Save bltavares/7fd1d4babf5c40f515dc41697ee64a72 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pub fn with_discovery(&mut self, mechanisms: Vec<impl Stream<Item = SocketAddr>>) { | |
let stream = mechanisms | |
.into_iter() | |
.fold(stream::pending(), |init, item| init.merge(item)); | |
/// mismatched types | |
/// expected struct `async_std::stream::pending::Pending<_>` | |
/// found struct `async_std::stream::stream::merge::Merge<async_std::stream::pending::Pending<_>, impl Stream<Item = SocketAddr>>` | |
} | |
pub fn with_discovery_iter(&mut self, mechanisms: Vec<impl Stream<Item = SocketAddr>>) { | |
let stream = stream::pending(); | |
for item in mechanisms { | |
stream = stream.merge(item); | |
/// mismatched types | |
/// expected struct `async_std::stream::pending::Pending<_>` | |
/// found struct `async_std::stream::stream::merge::Merge<async_std::stream::pending::Pending<_>, impl Stream<Item = SocketAddr>>` | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment