Bump tokio-util from 0.2.0 to 0.3.1

Bumps [tokio-util](https://github.com/tokio-rs/tokio) from 0.2.0 to 0.3.1.
- [Release notes](https://github.com/tokio-rs/tokio/releases)
- [Commits](https://github.com/tokio-rs/tokio/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
This commit is contained in:
dependabot-preview[bot] 2020-04-27 13:02:50 +00:00 committed by Eric Förster
parent 796ec96592
commit 3337466964
4 changed files with 8 additions and 9 deletions

8
Cargo.lock generated
View file

@ -2156,7 +2156,7 @@ dependencies = [
"texlab-syntax 0.1.0",
"texlab-tex 0.1.0",
"tokio 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"uuid 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2307,7 +2307,7 @@ dependencies = [
"serde 1.0.106 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_json 1.0.51 (registry+https://github.com/rust-lang/crates.io-index)",
"serde_repr 0.1.5 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)",
"tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
"url 2.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
@ -2507,7 +2507,7 @@ dependencies = [
[[package]]
name = "tokio-util"
version = "0.2.0"
version = "0.3.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"bytes 0.5.4 (registry+https://github.com/rust-lang/crates.io-index)",
@ -3069,7 +3069,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum titlecase 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f565e410cfc24c2f2a89960b023ca192689d7f77d3f8d4f4af50c2d8affe1117"
"checksum tokio 0.2.19 (registry+https://github.com/rust-lang/crates.io-index)" = "7d9c43f1bb96970e153bcbae39a65e249ccb942bd9d36dbdf086024920417c9c"
"checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389"
"checksum tokio-util 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930"
"checksum tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499"
"checksum typenum 1.11.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9"
"checksum ucd-trie 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "56dee185309b50d1f11bfedef0fe6d036842e3fb77413abef29f8f8d1c5d4c1c"
"checksum unic-char-property 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8c57a407d9b6fa02b4795eb81c5b6652060a15a7903ea981f3d723e6c0be221"

View file

@ -46,7 +46,7 @@ texlab-symbol = { path = "crates/texlab_symbol" }
texlab-syntax = { path = "crates/texlab_syntax" }
texlab-tex = { path = "crates/texlab_tex" }
tokio = { version = "0.2", features = ["full"] }
tokio-util = { version = "0.2", features = ["codec"] }
tokio-util = { version = "0.3", features = ["codec"] }
uuid = { version = "0.8", features = ["v4"] }
[dev-dependencies]

View file

@ -21,5 +21,5 @@ nom = "5.1"
serde = { version = "1.0", features = ["derive", "rc"] }
serde_json = "1.0"
serde_repr = "0.1"
tokio-util = { version = "0.2", features = ["codec"] }
tokio-util = { version = "0.3", features = ["codec"] }
url = "2.1"

View file

@ -29,11 +29,10 @@ impl Decoder for LspCodec {
}
}
impl Encoder for LspCodec {
type Item = String;
impl Encoder<String> for LspCodec {
type Error = Error;
fn encode(&mut self, item: Self::Item, dst: &mut BytesMut) -> Result<(), Self::Error> {
fn encode(&mut self, item: String, dst: &mut BytesMut) -> Result<(), Self::Error> {
let message = format!("Content-Length: {}\r\n\r\n{}", item.len(), item);
trace!("Sent message:\n{}\n", message);