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 -24
View File
@@ -15,23 +15,25 @@
// See the License for the specific language governing permissions and
// limitations under the License.
use futures::{
channel::{mpsc, oneshot},
compat::*,
future::{ok, ready, select},
prelude::*,
};
use futures01::sync::mpsc as mpsc01;
use libp2p_wasm_ext::{ffi, ExtTransport};
use log::{debug, info};
use sc_chain_spec::Extension;
use sc_network::config::TransportConfig;
use sc_service::{
RpcSession, Role, Configuration, TaskManager, RpcHandlers,
config::{DatabaseConfig, KeystoreConfig, NetworkConfiguration},
GenericChainSpec, RuntimeGenesis,
KeepBlocks, TransactionStorageMode,
Configuration, GenericChainSpec, KeepBlocks, Role, RpcHandlers, RpcSession, RuntimeGenesis,
TaskManager, TransactionStorageMode,
};
use sc_tracing::logging::LoggerBuilder;
use wasm_bindgen::prelude::*;
use futures::{
prelude::*, channel::{oneshot, mpsc}, compat::*, future::{ready, ok, select}
};
use std::pin::Pin;
use sc_chain_spec::Extension;
use libp2p_wasm_ext::{ExtTransport, ffi};
use wasm_bindgen::prelude::*;
pub use console_error_panic_hook::set_once as set_console_error_panic_hook;
@@ -73,7 +75,8 @@ where
task_executor: (|fut, _| {
wasm_bindgen_futures::spawn_local(fut);
async {}
}).into(),
})
.into(),
telemetry_external_transport: Some(transport),
role: Role::Light,
database: {
@@ -114,9 +117,7 @@ where
max_runtime_instances: 8,
announce_block: true,
base_path: None,
informant_output_format: sc_informant::OutputFormat {
enable_color: false,
},
informant_output_format: sc_informant::OutputFormat { enable_color: false },
disable_log_reloading: false,
};
@@ -153,12 +154,11 @@ pub fn start_client(mut task_manager: TaskManager, rpc_handlers: RpcHandlers) ->
Box::pin(async move {
let _ = task_manager.future().await;
}),
).map(drop)
)
.map(drop),
);
Client {
rpc_send_tx,
}
Client { rpc_send_tx }
}
#[wasm_bindgen]
@@ -175,12 +175,8 @@ impl Client {
});
wasm_bindgen_futures::future_to_promise(async {
match rx.await {
Ok(fut) => {
fut.await
.map(|s| JsValue::from_str(&s))
.ok_or_else(|| JsValue::NULL)
},
Err(_) => Err(JsValue::NULL)
Ok(fut) => fut.await.map(|s| JsValue::from_str(&s)).ok_or_else(|| JsValue::NULL),
Err(_) => Err(JsValue::NULL),
}
})
}
@@ -203,7 +199,8 @@ impl Client {
});
wasm_bindgen_futures::spawn_local(async move {
let _ = rx.compat()
let _ = rx
.compat()
.try_for_each(|s| {
let _ = callback.call1(&callback, &JsValue::from_str(&s));
ok(())