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
+21 -15
View File
@@ -22,13 +22,15 @@ pub mod error;
pub mod helpers;
use crate::helpers::Receiver;
use futures::{compat::Compat, future::BoxFuture};
use jsonrpc_derive::rpc;
use futures::{future::BoxFuture, compat::Compat};
use self::error::Result as SystemResult;
pub use self::helpers::{SystemInfo, Health, PeerInfo, NodeRole, SyncState};
pub use self::gen_client::Client as SystemClient;
pub use self::{
gen_client::Client as SystemClient,
helpers::{Health, NodeRole, PeerInfo, SyncState, SystemInfo},
};
/// Substrate system RPC API
#[rpc]
@@ -74,8 +76,9 @@ pub trait SystemApi<Hash, Number> {
/// Returns currently connected peers
#[rpc(name = "system_peers", returns = "Vec<PeerInfo<Hash, Number>>")]
fn system_peers(&self)
-> Compat<BoxFuture<'static, jsonrpc_core::Result<Vec<PeerInfo<Hash, Number>>>>>;
fn system_peers(
&self,
) -> Compat<BoxFuture<'static, jsonrpc_core::Result<Vec<PeerInfo<Hash, Number>>>>>;
/// Returns current state of the network.
///
@@ -84,8 +87,9 @@ pub trait SystemApi<Hash, Number> {
// TODO: the future of this call is uncertain: https://github.com/paritytech/substrate/issues/1890
// https://github.com/paritytech/substrate/issues/5541
#[rpc(name = "system_unstable_networkState", returns = "jsonrpc_core::Value")]
fn system_network_state(&self)
-> Compat<BoxFuture<'static, jsonrpc_core::Result<jsonrpc_core::Value>>>;
fn system_network_state(
&self,
) -> Compat<BoxFuture<'static, jsonrpc_core::Result<jsonrpc_core::Value>>>;
/// Adds a reserved peer. Returns the empty string or an error. The string
/// parameter should encode a `p2p` multiaddr.
@@ -93,14 +97,18 @@ pub trait SystemApi<Hash, Number> {
/// `/ip4/198.51.100.19/tcp/30333/p2p/QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV`
/// is an example of a valid, passing multiaddr with PeerId attached.
#[rpc(name = "system_addReservedPeer", returns = "()")]
fn system_add_reserved_peer(&self, peer: String)
-> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
fn system_add_reserved_peer(
&self,
peer: String,
) -> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
/// Remove a reserved peer. Returns the empty string or an error. The string
/// should encode only the PeerId e.g. `QmSk5HQbn6LhUwDiNMseVUjuRYhEtYj4aUZ6WfWoGURpdV`.
#[rpc(name = "system_removeReservedPeer", returns = "()")]
fn system_remove_reserved_peer(&self, peer_id: String)
-> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
fn system_remove_reserved_peer(
&self,
peer_id: String,
) -> Compat<BoxFuture<'static, Result<(), jsonrpc_core::Error>>>;
/// Returns the list of reserved peers
#[rpc(name = "system_reservedPeers", returns = "Vec<String>")]
@@ -121,11 +129,9 @@ pub trait SystemApi<Hash, Number> {
///
/// `sync=debug,state=trace`
#[rpc(name = "system_addLogFilter", returns = "()")]
fn system_add_log_filter(&self, directives: String)
-> Result<(), jsonrpc_core::Error>;
fn system_add_log_filter(&self, directives: String) -> Result<(), jsonrpc_core::Error>;
/// Resets the log filter to Substrate defaults
#[rpc(name = "system_resetLogFilter", returns = "()")]
fn system_reset_log_filter(&self)
-> Result<(), jsonrpc_core::Error>;
fn system_reset_log_filter(&self) -> Result<(), jsonrpc_core::Error>;
}