async_std/unit/from_stream.rs
1use std::pin::Pin;
2
3use crate::prelude::*;
4use crate::stream::{FromStream, IntoStream};
5
6impl FromStream<()> for () {
7 #[inline]
8 fn from_stream<'a, S: IntoStream<Item = ()> + 'a>(
9 stream: S,
10 ) -> Pin<Box<dyn Future<Output = Self> + 'a + Send>>
11 where
12 <S as IntoStream>::IntoStream: Send,
13 {
14 Box::pin(stream.into_stream().for_each(drop))
15 }
16}