Skip to content

Commit 2c15c6a

Browse files
rubdoscramertj
authored andcommitted
Implements Clone on Sink combinators where it makes sense.
1 parent 2878009 commit 2c15c6a

File tree

4 files changed

+5
-4
lines changed

4 files changed

+5
-4
lines changed

futures-util/src/sink/err_into.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use sink::{SinkExt, SinkMapErr};
66
/// A sink combinator to change the error type of a sink.
77
///
88
/// This is created by the `Sink::err_into` method.
9-
#[derive(Debug)]
9+
#[derive(Clone, Debug)]
1010
#[must_use = "futures do nothing unless polled"]
1111
pub struct SinkErrInto<S: Sink, E> {
1212
sink: SinkMapErr<S, fn(S::SinkError) -> E>,

futures-util/src/sink/fanout.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use futures_sink::{ Sink};
88
///
99
/// Backpressure from any downstream sink propagates up, which means that this sink
1010
/// can only process items as fast as its _slowest_ downstream sink.
11+
#[derive(Clone)]
1112
pub struct Fanout<A: Sink, B: Sink> {
1213
left: A,
1314
right: B

futures-util/src/sink/map_err.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ use futures_core::task;
33
use futures_sink::{Sink};
44

55
/// Sink for the `Sink::sink_map_err` combinator.
6-
#[derive(Debug)]
6+
#[derive(Clone, Debug)]
77
#[must_use = "sinks do nothing unless polled"]
88
pub struct SinkMapErr<S, F> {
99
sink: S,

futures-util/src/sink/with.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ use futures_sink::{Sink};
77

88
/// Sink for the `Sink::with` combinator, chaining a computation to run *prior*
99
/// to pushing a value into the underlying sink.
10-
#[derive(Debug)]
10+
#[derive(Clone, Debug)]
1111
#[must_use = "sinks do nothing unless polled"]
1212
pub struct With<S, U, Fut, F>
1313
where S: Sink,
@@ -20,7 +20,7 @@ pub struct With<S, U, Fut, F>
2020
_phantom: PhantomData<fn(U)>,
2121
}
2222

23-
#[derive(Debug)]
23+
#[derive(Clone, Debug)]
2424
enum State<Fut, T> {
2525
Empty,
2626
Process(Fut),

0 commit comments

Comments
 (0)