diff --git a/futures-util/src/stream/empty.rs b/futures-util/src/stream/empty.rs index 903af6851d..d228b31581 100644 --- a/futures-util/src/stream/empty.rs +++ b/futures-util/src/stream/empty.rs @@ -38,3 +38,9 @@ impl Stream for Empty { (0, Some(0)) } } + +impl Clone for Empty { + fn clone(&self) -> Self { + empty() + } +} diff --git a/futures-util/src/stream/pending.rs b/futures-util/src/stream/pending.rs index bbe07504b7..ca793c1e04 100644 --- a/futures-util/src/stream/pending.rs +++ b/futures-util/src/stream/pending.rs @@ -36,3 +36,9 @@ impl Stream for Pending { (0, Some(0)) } } + +impl Clone for Pending { + fn clone(&self) -> Self { + pending() + } +} diff --git a/futures-util/src/stream/repeat.rs b/futures-util/src/stream/repeat.rs index 21749eb71d..6a2637d3f5 100644 --- a/futures-util/src/stream/repeat.rs +++ b/futures-util/src/stream/repeat.rs @@ -3,7 +3,7 @@ use futures_core::stream::{Stream, FusedStream}; use futures_core::task::{Context, Poll}; /// Stream for the [`repeat`] function. -#[derive(Debug)] +#[derive(Debug, Clone)] #[must_use = "streams do nothing unless polled"] pub struct Repeat { item: T,