Upgrade to bytes 0.6 (#497)

* Upgrade to bytes 0.6

* Update Cargo.toml

Co-authored-by: Eliza Weisman <eliza@buoyant.io>

* Update tests/h2-support/Cargo.toml

Co-authored-by: Eliza Weisman <eliza@buoyant.io>

Co-authored-by: Eliza Weisman <eliza@buoyant.io>
This commit is contained in:
Paolo Barbolini
2020-11-19 23:38:56 +01:00
committed by GitHub
parent cbbdd305b1
commit 5a92f256c0
11 changed files with 17 additions and 20 deletions

View File

@@ -45,9 +45,9 @@ members = [
futures-core = { version = "0.3", default-features = false } futures-core = { version = "0.3", default-features = false }
futures-sink = { version = "0.3", default-features = false } futures-sink = { version = "0.3", default-features = false }
futures-util = { version = "0.3", default-features = false } futures-util = { version = "0.3", default-features = false }
tokio-util = { version = "0.4.0", features = ["codec"] } tokio-util = { version = "0.5", features = ["codec"] }
tokio = { version = "0.3", features = ["io-util"] } tokio = { version = "0.3.2", features = ["io-util"] }
bytes = "0.5.2" bytes = "0.6"
http = "0.2" http = "0.2"
tracing = { version = "0.1.13", default-features = false, features = ["std", "log"] } tracing = { version = "0.1.13", default-features = false, features = ["std", "log"] }
tracing-futures = { version = "0.2", default-features = false, features = ["std-future"]} tracing-futures = { version = "0.2", default-features = false, features = ["std-future"]}
@@ -68,7 +68,7 @@ serde = "1.0.0"
serde_json = "1.0.0" serde_json = "1.0.0"
# Examples # Examples
tokio = { version = "0.3", features = ["rt-multi-thread", "macros", "sync", "net"] } tokio = { version = "0.3.2", features = ["rt-multi-thread", "macros", "sync", "net"] }
env_logger = { version = "0.5.3", default-features = false } env_logger = { version = "0.5.3", default-features = false }
rustls = "0.18" rustls = "0.18"
tokio-rustls = "0.20.0" tokio-rustls = "0.20.0"

View File

@@ -3,7 +3,7 @@ use crate::codec::UserError::*;
use crate::frame::{self, Frame, FrameSize}; use crate::frame::{self, Frame, FrameSize};
use crate::hpack; use crate::hpack;
use bytes::{buf::BufMutExt, Buf, BufMut, BytesMut}; use bytes::{buf::BufMut, Buf, BytesMut};
use std::pin::Pin; use std::pin::Pin;
use std::task::{Context, Poll}; use std::task::{Context, Poll};
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf}; use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};

View File

@@ -10,7 +10,7 @@ use bytes::{Bytes, BytesMut};
use std::fmt; use std::fmt;
use std::io::Cursor; use std::io::Cursor;
type EncodeBuf<'a> = bytes::buf::ext::Limit<&'a mut BytesMut>; type EncodeBuf<'a> = bytes::buf::Limit<&'a mut BytesMut>;
// Minimum MAX_FRAME_SIZE is 16kb, so save some arbitrary space for frame // Minimum MAX_FRAME_SIZE is 16kb, so save some arbitrary space for frame
// head and other header bits. // head and other header bits.

View File

@@ -1,7 +1,7 @@
use super::table::{Index, Table}; use super::table::{Index, Table};
use super::{huffman, Header}; use super::{huffman, Header};
use bytes::{buf::ext::Limit, BufMut, BytesMut}; use bytes::{buf::Limit, BufMut, BytesMut};
use http::header::{HeaderName, HeaderValue}; use http::header::{HeaderName, HeaderValue};
type DstBuf<'a> = Limit<&'a mut BytesMut>; type DstBuf<'a> = Limit<&'a mut BytesMut>;
@@ -428,7 +428,7 @@ fn rewind(buf: &mut DstBuf<'_>, pos: usize) {
mod test { mod test {
use super::*; use super::*;
use crate::hpack::Header; use crate::hpack::Header;
use bytes::buf::BufMutExt; use bytes::buf::BufMut;
use http::*; use http::*;
#[test] #[test]

View File

@@ -1,6 +1,6 @@
use crate::hpack::{Decoder, Encoder, Header}; use crate::hpack::{Decoder, Encoder, Header};
use bytes::{buf::BufMutExt, BytesMut}; use bytes::{buf::BufMut, BytesMut};
use hex::FromHex; use hex::FromHex;
use serde_json::Value; use serde_json::Value;

View File

@@ -2,7 +2,7 @@ use crate::hpack::{Decoder, Encode, Encoder, Header};
use http::header::{HeaderName, HeaderValue}; use http::header::{HeaderName, HeaderValue};
use bytes::{buf::BufMutExt, Bytes, BytesMut}; use bytes::{buf::BufMut, Bytes, BytesMut};
use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult}; use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult};
use rand::{Rng, SeedableRng, StdRng}; use rand::{Rng, SeedableRng, StdRng};

View File

@@ -6,7 +6,7 @@ use crate::frame::{Reason, StreamId};
use crate::codec::UserError; use crate::codec::UserError;
use crate::codec::UserError::*; use crate::codec::UserError::*;
use bytes::buf::ext::{BufExt, Take}; use bytes::buf::{Buf, Take};
use std::io; use std::io;
use std::task::{Context, Poll, Waker}; use std::task::{Context, Poll, Waker};
use std::{cmp, fmt, mem}; use std::{cmp, fmt, mem};

View File

@@ -11,5 +11,5 @@ h2 = { path = "../.." }
env_logger = { version = "0.5.3", default-features = false } env_logger = { version = "0.5.3", default-features = false }
futures = { version = "0.3", default-features = false, features = ["std"] } futures = { version = "0.3", default-features = false, features = ["std"] }
honggfuzz = "0.5" honggfuzz = "0.5"
http = "0.2" http = { git = "https://github.com/paolobarbolini/http.git", branch = "bytes06" }
tokio = { version = "0.3", features = [] } tokio = { version = "0.3.2", features = [] }

View File

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

View File

@@ -42,10 +42,7 @@ pub use super::client_ext::SendRequestExt;
// Re-export HTTP types // Re-export HTTP types
pub use http::{uri, HeaderMap, Method, Request, Response, StatusCode, Version}; pub use http::{uri, HeaderMap, Method, Request, Response, StatusCode, Version};
pub use bytes::{ pub use bytes::{Buf, BufMut, Bytes, BytesMut};
buf::{BufExt, BufMutExt},
Buf, BufMut, Bytes, BytesMut,
};
pub use tokio::io::{AsyncRead, AsyncWrite}; pub use tokio::io::{AsyncRead, AsyncWrite};

View File

@@ -11,4 +11,4 @@ edition = "2018"
h2-support = { path = "../h2-support" } h2-support = { path = "../h2-support" }
tracing = "0.1.13" tracing = "0.1.13"
futures = { version = "0.3", default-features = false, features = ["alloc"] } futures = { version = "0.3", default-features = false, features = ["alloc"] }
tokio = { version = "0.3", features = ["macros", "net", "rt", "io-util"] } tokio = { version = "0.3.2", features = ["macros", "net", "rt", "io-util"] }