Fix unneeded mut and some deprecated api (#442)

This commit is contained in:
Roman 2018-06-21 20:47:21 +04:00 committed by Carl Lerche
parent 7153d8d6ce
commit 3cf56b7bfa
3 changed files with 4 additions and 4 deletions

View File

@ -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 || {
{

View File

@ -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::<BigEndian>();
let n = buf.split_to(4).into_buf().get_u32_be();
Ok(Some(n))
}
}

View File

@ -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;