From 3cf56b7bfa98455801748bc5351238ada93d8ea8 Mon Sep 17 00:00:00 2001 From: Roman Date: Thu, 21 Jun 2018 20:47:21 +0400 Subject: [PATCH] Fix unneeded mut and some deprecated api (#442) --- tests/runtime.rs | 2 +- tokio-codec/tests/framed_read.rs | 4 ++-- tokio-codec/tests/framed_write.rs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/runtime.rs b/tests/runtime.rs index 738e4a9df..06ada9c80 100644 --- a/tests/runtime.rs +++ b/tests/runtime.rs @@ -179,7 +179,7 @@ fn spawn_from_block_on_all() { let cnt = Arc::new(Mutex::new(0)); let c = cnt.clone(); - let mut runtime = Runtime::new().unwrap(); + let runtime = Runtime::new().unwrap(); let msg = runtime .block_on_all(lazy(move || { { diff --git a/tokio-codec/tests/framed_read.rs b/tokio-codec/tests/framed_read.rs index 80dfa5e50..805229a0e 100644 --- a/tokio-codec/tests/framed_read.rs +++ b/tokio-codec/tests/framed_read.rs @@ -6,7 +6,7 @@ extern crate futures; use tokio_io::AsyncRead; use tokio_codec::{FramedRead, Decoder}; -use bytes::{BytesMut, Buf, IntoBuf, BigEndian}; +use bytes::{BytesMut, Buf, IntoBuf}; use futures::Stream; use futures::Async::{Ready, NotReady}; @@ -32,7 +32,7 @@ impl Decoder for U32Decoder { return Ok(None); } - let n = buf.split_to(4).into_buf().get_u32::(); + let n = buf.split_to(4).into_buf().get_u32_be(); Ok(Some(n)) } } diff --git a/tokio-codec/tests/framed_write.rs b/tokio-codec/tests/framed_write.rs index 137fb5be1..7b3b4bd57 100644 --- a/tokio-codec/tests/framed_write.rs +++ b/tokio-codec/tests/framed_write.rs @@ -7,7 +7,7 @@ use tokio_io::AsyncWrite; use tokio_codec::{Encoder, FramedWrite}; use futures::{Sink, Poll}; -use bytes::{BytesMut, BufMut, BigEndian}; +use bytes::{BytesMut, BufMut}; use std::io::{self, Write}; use std::collections::VecDeque;