mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-28 15:37:56 +00:00
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:
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user