mirror of
https://github.com/tokio-rs/tokio.git
synced 2026-09-08 00:00:13 +02:00
chore: apply rustfmt to all crates (#917)
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user