Update to Tokio and Bytes 1.0 (#504)

This commit is contained in:
Sean McArthur
2020-12-23 10:01:44 -08:00
committed by GitHub
parent dc3079ab89
commit b4976675fa
10 changed files with 38 additions and 32 deletions

View File

@@ -7,10 +7,10 @@ edition = "2018"
[dependencies]
h2 = { path = "../..", features = ["stream", "unstable"] }
bytes = "0.6"
bytes = "1"
tracing = "0.1"
tracing-subscriber = { version = "0.2", default-features = false, features = ["fmt", "chrono", "ansi"] }
futures = { version = "0.3", default-features = false }
http = "0.2"
tokio = { version = "0.3.2", features = ["time"] }
tokio-test = "0.3"
tokio = { version = "1", features = ["time"] }
tokio-test = "0.4"

View File

@@ -147,7 +147,7 @@ impl Handle {
poll_fn(move |cx| {
while buf.has_remaining() {
let res = Pin::new(self.codec.get_mut())
.poll_write(cx, &mut buf.bytes())
.poll_write(cx, &mut buf.chunk())
.map_err(|e| panic!("write err={:?}", e));
let n = ready!(res).unwrap();