From 7a246f1d9cc5162469ab66f0557cb5820a35a048 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Th=C3=A9o=20Gaillard?= Date: Fri, 6 Mar 2020 07:52:26 +0800 Subject: [PATCH] fix: upgrade tokio-util from 0.2 to 0.3 --- Cargo.toml | 4 ++-- irc-proto/Cargo.toml | 11 ++++++----- irc-proto/src/irc.rs | 3 +-- irc-proto/src/line.rs | 3 +-- 4 files changed, 10 insertions(+), 11 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index bc63221..5fb8225 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,8 +42,8 @@ log = "0.4" native-tls = "0.2" serde = { version = "1.0", features = ["derive"], optional = true } serde_derive = { version = "1.0", optional = true } -tokio = { version = "0.2.4", features = ["time", "net", "stream", "macros", "stream"] } -tokio-util = { version = "0.2.0", features = ["codec"] } +tokio = { version = "0.2.4", features = ["time", "net", "stream", "macros"] } +tokio-util = { version = "0.3.0", features = ["codec"] } tokio-tls = "0.3.0" serde_json = { version = "1.0", optional = true } serde_yaml = { version = "0.8", optional = true } diff --git a/irc-proto/Cargo.toml b/irc-proto/Cargo.toml index 6a870b6..4dc7e6e 100644 --- a/irc-proto/Cargo.toml +++ b/irc-proto/Cargo.toml @@ -14,11 +14,12 @@ edition = "2018" travis-ci = { repository = "aatxe/irc" } [features] -default = ["tokio", "tokio-util", "bytes"] +default = ["bytes", "tokio", "tokio-util"] [dependencies] -bytes = { version = "0.5", optional = true } -encoding = "0.2" -thiserror = "1.0.2" -tokio-util = { version = "0.2.0", features = ["codec"], optional = true } +encoding = "0.2.0" +thiserror = "1.0.0" + +bytes = { version = "0.5.0", optional = true } tokio = { version = "0.2.0", optional = true } +tokio-util = { version = "0.3.0", features = ["codec"], optional = true } diff --git a/irc-proto/src/irc.rs b/irc-proto/src/irc.rs index 33fa3dc..afd14f0 100644 --- a/irc-proto/src/irc.rs +++ b/irc-proto/src/irc.rs @@ -44,8 +44,7 @@ impl Decoder for IrcCodec { } } -impl Encoder for IrcCodec { - type Item = Message; +impl Encoder for IrcCodec { type Error = error::ProtocolError; fn encode(&mut self, msg: Message, dst: &mut BytesMut) -> error::Result<()> { diff --git a/irc-proto/src/line.rs b/irc-proto/src/line.rs index 85283f9..8c83cdd 100644 --- a/irc-proto/src/line.rs +++ b/irc-proto/src/line.rs @@ -63,8 +63,7 @@ impl Decoder for LineCodec { } } -impl Encoder for LineCodec { - type Item = String; +impl Encoder for LineCodec { type Error = error::ProtocolError; fn encode(&mut self, msg: String, dst: &mut BytesMut) -> error::Result<()> {