Run cargo fmt on the whole code base (#9394)

* Run cargo fmt on the whole code base

* Second run

* Add CI check

* Fix compilation

* More unnecessary braces

* Handle weights

* Use --all

* Use correct attributes...

* Fix UI tests

* AHHHHHHHHH

* 🤦

* Docs

* Fix compilation

* 🤷

* Please stop

* 🤦 x 2

* More

* make rustfmt.toml consistent with polkadot

Co-authored-by: André Silva <andrerfosilva@gmail.com>
This commit is contained in:
Bastian Köcher
2021-07-21 16:32:32 +02:00
committed by GitHub
parent d451c38c1c
commit 7b56ab15b4
1010 changed files with 53339 additions and 51208 deletions
+15 -13
View File
@@ -16,8 +16,11 @@
// limitations under the License.
use async_std::pin::Pin;
use std::task::{Poll, Context};
use futures_util::{stream::Stream, io::{AsyncRead, AsyncWrite}};
use futures_util::{
io::{AsyncRead, AsyncWrite},
stream::Stream,
};
use std::task::{Context, Poll};
pub struct Incoming<'a>(pub async_std::net::Incoming<'a>);
@@ -25,7 +28,10 @@ impl hyper::server::accept::Accept for Incoming<'_> {
type Conn = TcpStream;
type Error = async_std::io::Error;
fn poll_accept(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
fn poll_accept(
self: Pin<&mut Self>,
cx: &mut Context,
) -> Poll<Option<Result<Self::Conn, Self::Error>>> {
Pin::new(&mut Pin::into_inner(self).0)
.poll_next(cx)
.map(|opt| opt.map(|res| res.map(TcpStream)))
@@ -38,10 +44,9 @@ impl tokio::io::AsyncRead for TcpStream {
fn poll_read(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &mut [u8]
buf: &mut [u8],
) -> Poll<Result<usize, std::io::Error>> {
Pin::new(&mut Pin::into_inner(self).0)
.poll_read(cx, buf)
Pin::new(&mut Pin::into_inner(self).0).poll_read(cx, buf)
}
}
@@ -49,19 +54,16 @@ impl tokio::io::AsyncWrite for TcpStream {
fn poll_write(
self: Pin<&mut Self>,
cx: &mut Context,
buf: &[u8]
buf: &[u8],
) -> Poll<Result<usize, std::io::Error>> {
Pin::new(&mut Pin::into_inner(self).0)
.poll_write(cx, buf)
Pin::new(&mut Pin::into_inner(self).0).poll_write(cx, buf)
}
fn poll_flush(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), std::io::Error>> {
Pin::new(&mut Pin::into_inner(self).0)
.poll_flush(cx)
Pin::new(&mut Pin::into_inner(self).0).poll_flush(cx)
}
fn poll_shutdown(self: Pin<&mut Self>, cx: &mut Context) -> Poll<Result<(), std::io::Error>> {
Pin::new(&mut Pin::into_inner(self).0)
.poll_close(cx)
Pin::new(&mut Pin::into_inner(self).0).poll_close(cx)
}
}