-
Notifications
You must be signed in to change notification settings - Fork 653
Extend compatibility to Stream and Sink #1162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
futures-util/src/sink/mod.rs
Outdated
@@ -248,4 +254,14 @@ pub trait SinkExt: Sink { | |||
{ | |||
Either::Right(self) | |||
} | |||
|
|||
/// Wraps a [`Sink`] into a sink compatible with libraries using | |||
/// futures 0.1 `Sink`. Requires the `compat` feature to enable. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
to be enabled
Some lines are longer than 80 chars |
/// Converts a futures 0.3 `TryFuture` into a futures 0.1 `Future` | ||
/// and vice versa. | ||
/// Converts a futures 0.3 `TryFuture`, `TryStream` or `Sink` into a futures 0.1 | ||
/// `Future` and vice versa. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These should be links
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah never mind. Let's do the docs stuff in another PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, I started doing it then decided to just leave it for another pass.
Oh, are we using an 80 character limit? I just applied |
@Nemo157 That'd be great! |
5527024
to
a5b7397
Compare
RE rustfmt: be aware that for |
I was only applying it to a couple of files so luckily didn’t hit that, did discover rust-lang/rustfmt#2887 on my next change though 😢 |
Sink is unidirectional because
Sink01::start_send
was split intoSink03::poll_ready
+Sink03::start_send
which makes tracking the context across the two method calls painful (might be possible with a customCompat
struct for this case, but I didn't investigate much).