From 3db9eeae2f46f8d81027319dd2bd8cbc82aa4cc0 Mon Sep 17 00:00:00 2001 From: Emmanuel Gil Peyrot Date: Mon, 22 Jun 2020 01:32:01 +0200 Subject: [PATCH] tokio-xmpp: Bump tokio-util --- tokio-xmpp/Cargo.toml | 2 +- tokio-xmpp/src/xmpp_codec.rs | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tokio-xmpp/Cargo.toml b/tokio-xmpp/Cargo.toml index d6a9f39b..c5aa823e 100644 --- a/tokio-xmpp/Cargo.toml +++ b/tokio-xmpp/Cargo.toml @@ -19,7 +19,7 @@ log = "0.4" native-tls = "0.2" sasl = "0.4" tokio = { version = "0.2", features = ["net", "stream", "rt-util", "rt-threaded", "macros"] } -tokio-util = { version = "0.2", features = ["codec"] } +tokio-util = { version = "0.3", features = ["codec"] } tokio-tls = "0.3" trust-dns-resolver = "0.19" trust-dns-proto = "0.19" diff --git a/tokio-xmpp/src/xmpp_codec.rs b/tokio-xmpp/src/xmpp_codec.rs index bbc0ee10..6c6b92cc 100644 --- a/tokio-xmpp/src/xmpp_codec.rs +++ b/tokio-xmpp/src/xmpp_codec.rs @@ -272,11 +272,10 @@ impl Decoder for XMPPCodec { } } -impl Encoder for XMPPCodec { - type Item = Packet; +impl Encoder for XMPPCodec { type Error = io::Error; - fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> { + fn encode(&mut self, item: Packet, dst: &mut BytesMut) -> Result<(), Self::Error> { let remaining = dst.capacity() - dst.len(); let max_stanza_size: usize = 2usize.pow(16); if remaining < max_stanza_size {