summaryrefslogtreecommitdiffstats
path: root/tokio-util/src/codec/framed_write.rs
diff options
context:
space:
mode:
Diffstat (limited to 'tokio-util/src/codec/framed_write.rs')
-rw-r--r--tokio-util/src/codec/framed_write.rs7
1 files changed, 3 insertions, 4 deletions
diff --git a/tokio-util/src/codec/framed_write.rs b/tokio-util/src/codec/framed_write.rs
index 80aa21c6..c0049b2d 100644
--- a/tokio-util/src/codec/framed_write.rs
+++ b/tokio-util/src/codec/framed_write.rs
@@ -42,7 +42,6 @@ const BACKPRESSURE_BOUNDARY: usize = INITIAL_CAPACITY;
impl<T, E> FramedWrite<T, E>
where
T: AsyncWrite,
- E: Encoder,
{
/// Creates a new `FramedWrite` with the given `encoder`.
pub fn new(inner: T, encoder: E) -> FramedWrite<T, E> {
@@ -100,7 +99,7 @@ impl<T, E> FramedWrite<T, E> {
impl<T, I, E> Sink<I> for FramedWrite<T, E>
where
T: AsyncWrite,
- E: Encoder<Item = I>,
+ E: Encoder<I>,
E::Error: From<io::Error>,
{
type Error = E::Error;
@@ -191,9 +190,9 @@ impl<T> FramedWrite2<T> {
impl<I, T> Sink<I> for FramedWrite2<T>
where
T: ProjectFuse + AsyncWrite,
- T::Codec: Encoder<Item = I>,
+ T::Codec: Encoder<I>,
{
- type Error = <T::Codec as Encoder>::Error;
+ type Error = <T::Codec as Encoder<I>>::Error;
fn poll_ready(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<Result<(), Self::Error>> {
// If the buffer is already over 8KiB, then attempt to flush it. If after flushing it's