mirror of
https://github.com/tokio-rs/tokio.git
synced 2025-09-28 12:10:37 +00:00
Fix unneeded mut and some deprecated api (#442)
This commit is contained in:
parent
7153d8d6ce
commit
3cf56b7bfa
@ -179,7 +179,7 @@ fn spawn_from_block_on_all() {
|
|||||||
let cnt = Arc::new(Mutex::new(0));
|
let cnt = Arc::new(Mutex::new(0));
|
||||||
let c = cnt.clone();
|
let c = cnt.clone();
|
||||||
|
|
||||||
let mut runtime = Runtime::new().unwrap();
|
let runtime = Runtime::new().unwrap();
|
||||||
let msg = runtime
|
let msg = runtime
|
||||||
.block_on_all(lazy(move || {
|
.block_on_all(lazy(move || {
|
||||||
{
|
{
|
||||||
|
@ -6,7 +6,7 @@ extern crate futures;
|
|||||||
use tokio_io::AsyncRead;
|
use tokio_io::AsyncRead;
|
||||||
use tokio_codec::{FramedRead, Decoder};
|
use tokio_codec::{FramedRead, Decoder};
|
||||||
|
|
||||||
use bytes::{BytesMut, Buf, IntoBuf, BigEndian};
|
use bytes::{BytesMut, Buf, IntoBuf};
|
||||||
use futures::Stream;
|
use futures::Stream;
|
||||||
use futures::Async::{Ready, NotReady};
|
use futures::Async::{Ready, NotReady};
|
||||||
|
|
||||||
@ -32,7 +32,7 @@ impl Decoder for U32Decoder {
|
|||||||
return Ok(None);
|
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))
|
Ok(Some(n))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@ use tokio_io::AsyncWrite;
|
|||||||
use tokio_codec::{Encoder, FramedWrite};
|
use tokio_codec::{Encoder, FramedWrite};
|
||||||
|
|
||||||
use futures::{Sink, Poll};
|
use futures::{Sink, Poll};
|
||||||
use bytes::{BytesMut, BufMut, BigEndian};
|
use bytes::{BytesMut, BufMut};
|
||||||
|
|
||||||
use std::io::{self, Write};
|
use std::io::{self, Write};
|
||||||
use std::collections::VecDeque;
|
use std::collections::VecDeque;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user