use std::clone::Clone; use futures::{stream::Map, Stream, StreamExt}; pub trait Cloned<'a, T, S> where S: Stream, T: Clone + 'a, { fn cloned(self) -> Map T>; } impl<'a, T, S> Cloned<'a, T, S> for S where S: Stream, T: Clone + 'a, { #[inline] fn cloned(self) -> Map T> { self.map(Clone::clone) } }