chore: apply rustfmt to all crates (#917)

This commit is contained in:
Carl Lerche
2019-02-21 11:56:15 -08:00
committed by GitHub
parent ab595d0825
commit 80162306e7
253 changed files with 3710 additions and 3407 deletions
+17 -5
View File
@@ -1,6 +1,6 @@
use {AsyncRead, AsyncWrite};
use futures::{Async, Poll};
use std::{fmt, io};
use {AsyncRead, AsyncWrite};
/// A simple wrapper type which allows types that only implement
/// `std::io::Read` or `std::io::Write` to be used in contexts which expect
@@ -37,7 +37,10 @@ impl<T> AllowStdIo<T> {
}
}
impl<T> io::Write for AllowStdIo<T> where T: io::Write {
impl<T> io::Write for AllowStdIo<T>
where
T: io::Write,
{
fn write(&mut self, buf: &[u8]) -> io::Result<usize> {
self.0.write(buf)
}
@@ -52,13 +55,19 @@ impl<T> io::Write for AllowStdIo<T> where T: io::Write {
}
}
impl<T> AsyncWrite for AllowStdIo<T> where T: io::Write {
impl<T> AsyncWrite for AllowStdIo<T>
where
T: io::Write,
{
fn shutdown(&mut self) -> Poll<(), io::Error> {
Ok(Async::Ready(()))
}
}
impl<T> io::Read for AllowStdIo<T> where T: io::Read {
impl<T> io::Read for AllowStdIo<T>
where
T: io::Read,
{
fn read(&mut self, buf: &mut [u8]) -> io::Result<usize> {
self.0.read(buf)
}
@@ -75,7 +84,10 @@ impl<T> io::Read for AllowStdIo<T> where T: io::Read {
}
}
impl<T> AsyncRead for AllowStdIo<T> where T: io::Read {
impl<T> AsyncRead for AllowStdIo<T>
where
T: io::Read,
{
// TODO: override prepare_uninitialized_buffer once `Read::initializer` is stable.
// See rust-lang/rust #42788
}