Skip to content

Commit

Permalink
Bump tokio to 1.0 (#21)
Browse files Browse the repository at this point in the history
  • Loading branch information
lberrymage authored Dec 24, 2020
1 parent c2a69a4 commit e9cd466
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ libraries.
"""

[dependencies]
bytes = "0.6"
bytes = "1.0"
educe = { version = "0.4", optional = true, default-features = false }
futures-core = "0.3"
futures-sink = "0.3"
Expand All @@ -36,8 +36,8 @@ serde_cbor = { version = "0.11", optional = true }
[dev-dependencies]
futures = "0.3"
impls = "1"
tokio = { version = "0.3", features = ["full"] }
tokio-util = { version = "0.5", features = ["codec"] }
tokio = { version = "1.0", features = ["full"] }
tokio-util = { version = "0.6", features = ["codec"] }
static_assertions = "1.1.0"

[package.metadata.docs.rs]
Expand Down
6 changes: 4 additions & 2 deletions examples/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,13 @@ use tokio_util::codec::{FramedRead, LengthDelimitedCodec};
#[tokio::main]
pub async fn main() {
// Bind a server socket
let mut listener = TcpListener::bind("127.0.0.1:17653").await.unwrap();
let listener = TcpListener::bind("127.0.0.1:17653").await.unwrap();

println!("listening on {:?}", listener.local_addr());

while let Some(socket) = listener.try_next().await.unwrap() {
loop {
let (socket, _) = listener.accept().await.unwrap();

// Delimit frames using a length header
let length_delimited = FramedRead::new(socket, LengthDelimitedCodec::new());

Expand Down

0 comments on commit e9cd466

Please sign in to comment.