Skip to content

Commit

Permalink
Upgrade to bytes 0.6 (#497)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
paolobarbolini and hawkw committed Nov 19, 2020
1 parent cbbdd30 commit 5a92f25
Show file tree
Hide file tree
Showing 11 changed files with 17 additions and 20 deletions.
8 changes: 4 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ members = [
futures-core = { version = "0.3", default-features = false }
futures-sink = { version = "0.3", default-features = false }
futures-util = { version = "0.3", default-features = false }
tokio-util = { version = "0.4.0", features = ["codec"] }
tokio = { version = "0.3", features = ["io-util"] }
bytes = "0.5.2"
tokio-util = { version = "0.5", features = ["codec"] }
tokio = { version = "0.3.2", features = ["io-util"] }
bytes = "0.6"
http = "0.2"
tracing = { version = "0.1.13", default-features = false, features = ["std", "log"] }
tracing-futures = { version = "0.2", default-features = false, features = ["std-future"]}
Expand All @@ -68,7 +68,7 @@ serde = "1.0.0"
serde_json = "1.0.0"

# 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 }
rustls = "0.18"
tokio-rustls = "0.20.0"
Expand Down
2 changes: 1 addition & 1 deletion src/codec/framed_write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use crate::codec::UserError::*;
use crate::frame::{self, Frame, FrameSize};
use crate::hpack;

use bytes::{buf::BufMutExt, Buf, BufMut, BytesMut};
use bytes::{buf::BufMut, Buf, BytesMut};
use std::pin::Pin;
use std::task::{Context, Poll};
use tokio::io::{AsyncRead, AsyncWrite, ReadBuf};
Expand Down
2 changes: 1 addition & 1 deletion src/frame/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ use bytes::{Bytes, BytesMut};
use std::fmt;
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
// head and other header bits.
Expand Down
4 changes: 2 additions & 2 deletions src/hpack/encoder.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use super::table::{Index, Table};
use super::{huffman, Header};

use bytes::{buf::ext::Limit, BufMut, BytesMut};
use bytes::{buf::Limit, BufMut, BytesMut};
use http::header::{HeaderName, HeaderValue};

type DstBuf<'a> = Limit<&'a mut BytesMut>;
Expand Down Expand Up @@ -428,7 +428,7 @@ fn rewind(buf: &mut DstBuf<'_>, pos: usize) {
mod test {
use super::*;
use crate::hpack::Header;
use bytes::buf::BufMutExt;
use bytes::buf::BufMut;
use http::*;

#[test]
Expand Down
2 changes: 1 addition & 1 deletion src/hpack/test/fixture.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
use crate::hpack::{Decoder, Encoder, Header};

use bytes::{buf::BufMutExt, BytesMut};
use bytes::{buf::BufMut, BytesMut};
use hex::FromHex;
use serde_json::Value;

Expand Down
2 changes: 1 addition & 1 deletion src/hpack/test/fuzz.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use crate::hpack::{Decoder, Encode, Encoder, Header};

use http::header::{HeaderName, HeaderValue};

use bytes::{buf::BufMutExt, Bytes, BytesMut};
use bytes::{buf::BufMut, Bytes, BytesMut};
use quickcheck::{Arbitrary, Gen, QuickCheck, TestResult};
use rand::{Rng, SeedableRng, StdRng};

Expand Down
2 changes: 1 addition & 1 deletion src/proto/streams/prioritize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::frame::{Reason, StreamId};
use crate::codec::UserError;
use crate::codec::UserError::*;

use bytes::buf::ext::{BufExt, Take};
use bytes::buf::{Buf, Take};
use std::io;
use std::task::{Context, Poll, Waker};
use std::{cmp, fmt, mem};
Expand Down
4 changes: 2 additions & 2 deletions tests/h2-fuzz/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ h2 = { path = "../.." }
env_logger = { version = "0.5.3", default-features = false }
futures = { version = "0.3", default-features = false, features = ["std"] }
honggfuzz = "0.5"
http = "0.2"
tokio = { version = "0.3", features = [] }
http = { git = "https://github.com/paolobarbolini/http.git", branch = "bytes06" }
tokio = { version = "0.3.2", features = [] }
4 changes: 2 additions & 2 deletions tests/h2-support/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ edition = "2018"
[dependencies]
h2 = { path = "../..", features = ["stream", "unstable"] }

bytes = "0.5"
bytes = "0.6"
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", features = ["time"] }
tokio = { version = "0.3.2", features = ["time"] }
tokio-test = "0.3"
5 changes: 1 addition & 4 deletions tests/h2-support/src/prelude.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,7 @@ pub use super::client_ext::SendRequestExt;
// Re-export HTTP types
pub use http::{uri, HeaderMap, Method, Request, Response, StatusCode, Version};

pub use bytes::{
buf::{BufExt, BufMutExt},
Buf, BufMut, Bytes, BytesMut,
};
pub use bytes::{Buf, BufMut, Bytes, BytesMut};

pub use tokio::io::{AsyncRead, AsyncWrite};

Expand Down
2 changes: 1 addition & 1 deletion tests/h2-tests/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ edition = "2018"
h2-support = { path = "../h2-support" }
tracing = "0.1.13"
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"] }

0 comments on commit 5a92f25

Please sign in to comment.