chore: format code and enable rustfmt CI task (#1212)

This commit is contained in:
Carl Lerche
2019-06-27 00:05:01 -07:00
committed by GitHub
parent 1f47ed3dcc
commit ed4d4a5353
22 changed files with 94 additions and 60 deletions
+11 -11
View File
@@ -1,6 +1,6 @@
use tokio_io::AsyncRead;
use tokio_test::{assert_ready_ok, assert_ready_err};
use tokio_test::task::MockTask;
use tokio_test::{assert_ready_err, assert_ready_ok};
use bytes::{BufMut, BytesMut};
use pin_utils::pin_mut;
@@ -22,8 +22,8 @@ fn read_buf_success() {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
buf: &mut [u8]) -> Poll<io::Result<usize>>
{
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
buf[0..11].copy_from_slice(b"hello world");
Poll::Ready(Ok(11))
}
@@ -51,8 +51,8 @@ fn read_buf_error() {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_buf: &mut [u8]) -> Poll<io::Result<usize>>
{
_buf: &mut [u8],
) -> Poll<io::Result<usize>> {
let err = io::ErrorKind::Other.into();
Poll::Ready(Err(err))
}
@@ -78,8 +78,8 @@ fn read_buf_no_capacity() {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
_buf: &mut [u8]) -> Poll<io::Result<usize>>
{
_buf: &mut [u8],
) -> Poll<io::Result<usize>> {
unimplemented!();
}
}
@@ -107,8 +107,8 @@ fn read_buf_no_uninitialized() {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
buf: &mut [u8]) -> Poll<io::Result<usize>>
{
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
for b in buf {
assert_eq!(0, *b);
}
@@ -141,8 +141,8 @@ fn read_buf_uninitialized_ok() {
fn poll_read(
self: Pin<&mut Self>,
_cx: &mut Context<'_>,
buf: &mut [u8]) -> Poll<io::Result<usize>>
{
buf: &mut [u8],
) -> Poll<io::Result<usize>> {
assert_eq!(buf[0..11], b"hello world"[..]);
Poll::Ready(Ok(0))
}