diff --git a/substrate/bin/node-template/node/src/command.rs b/substrate/bin/node-template/node/src/command.rs index d3a04e0ae91e815a749761133b0630419d6cfe8f..b4f0a1804f66c6d6b7a5fa7ef82b6cba64e7881c 100644 --- a/substrate/bin/node-template/node/src/command.rs +++ b/substrate/bin/node-template/node/src/command.rs @@ -121,8 +121,8 @@ pub fn run() -> sc_cli::Result<()> { runner.sync_run(|config| cmd.run::<Block, service::Executor>(config)) } else { - Err("Benchmarking wasn't enabled when building the node. \ - You can enable it with `--features runtime-benchmarks`." + Err("Benchmarking wasn't enabled when building the node. You can enable it with \ + `--features runtime-benchmarks`." .into()) }, None => { diff --git a/substrate/bin/node/executor/benches/bench.rs b/substrate/bin/node/executor/benches/bench.rs index 8ac4b90150806e8326962f1398175531319c9e31..cd201cfc95987fb9db97f39b5505a50a14cf2524 100644 --- a/substrate/bin/node/executor/benches/bench.rs +++ b/substrate/bin/node/executor/benches/bench.rs @@ -40,8 +40,8 @@ criterion_main!(benches); /// The wasm runtime code. pub fn compact_code_unwrap() -> &'static [u8] { node_runtime::WASM_BINARY.expect( - "Development wasm binary is not available. \ - Testing is only supported with the flag disabled.", + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", ) } diff --git a/substrate/bin/node/executor/tests/common.rs b/substrate/bin/node/executor/tests/common.rs index 414b335406be87d1f42810a352c75bbe60ccb5b9..f7cf8db003c0ebf07be3193fe18e901f52fd0b5a 100644 --- a/substrate/bin/node/executor/tests/common.rs +++ b/substrate/bin/node/executor/tests/common.rs @@ -71,8 +71,8 @@ impl AppCrypto<MultiSigner, MultiSignature> for TestAuthorityId { /// runtime. pub fn compact_code_unwrap() -> &'static [u8] { node_runtime::WASM_BINARY.expect( - "Development wasm binary is not available. \ - Testing is only supported with the flag disabled.", + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", ) } diff --git a/substrate/bin/node/runtime/src/lib.rs b/substrate/bin/node/runtime/src/lib.rs index 621de954c7349063e0e48d2f4443ef59052af5ab..90bd11d484b269193d5debea5732bc9f2b6eaa53 100644 --- a/substrate/bin/node/runtime/src/lib.rs +++ b/substrate/bin/node/runtime/src/lib.rs @@ -101,9 +101,9 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] { WASM_BINARY.expect( - "Development wasm binary is not available. This means the client is \ - built with `SKIP_WASM_BUILD` flag and it is only usable for \ - production chains. Please rebuild with the flag disabled.", + "Development wasm binary is not available. This means the client is built with \ + `SKIP_WASM_BUILD` flag and it is only usable for production chains. Please rebuild with \ + the flag disabled.", ) } diff --git a/substrate/client/cli/src/commands/run_cmd.rs b/substrate/client/cli/src/commands/run_cmd.rs index 8d4f72a5cc59dfa0af8f19002e52fed15214c8ad..fcc486297b21aa067eed7ce005503e29cb79eea6 100644 --- a/substrate/client/cli/src/commands/run_cmd.rs +++ b/substrate/client/cli/src/commands/run_cmd.rs @@ -487,10 +487,9 @@ fn rpc_interface( ) -> Result<IpAddr> { if is_external && is_validator && rpc_methods != RpcMethods::Unsafe { return Err(Error::Input( - "--rpc-external and --ws-external options shouldn't be \ - used if the node is running as a validator. Use `--unsafe-rpc-external` \ - or `--rpc-methods=unsafe` if you understand the risks. See the options \ - description for more information." + "--rpc-external and --ws-external options shouldn't be used if the node is running as \ + a validator. Use `--unsafe-rpc-external` or `--rpc-methods=unsafe` if you understand \ + the risks. See the options description for more information." .to_owned(), )) } @@ -499,7 +498,7 @@ fn rpc_interface( if rpc_methods == RpcMethods::Unsafe { log::warn!( "It isn't safe to expose RPC publicly without a proxy server that filters \ - available set of RPC methods." + available set of RPC methods." ); } diff --git a/substrate/client/consensus/aura/src/lib.rs b/substrate/client/consensus/aura/src/lib.rs index 341b0ed25cc46ef7db51d5c64db06ccac2717e2d..8efd39aa612eaf8de6e718aacdc018c0941b48a0 100644 --- a/substrate/client/consensus/aura/src/lib.rs +++ b/substrate/client/consensus/aura/src/lib.rs @@ -108,8 +108,7 @@ fn slot_author<P: Pair>(slot: Slot, authorities: &[AuthorityId<P>]) -> Option<&A ); let current_author = authorities.get(idx as usize).expect( - "authorities not empty; index constrained to list length;\ - this is a valid index; qed", + "authorities not empty; index constrained to list length;this is a valid index; qed", ); Some(current_author) diff --git a/substrate/client/consensus/babe/src/lib.rs b/substrate/client/consensus/babe/src/lib.rs index 315bd4e9921aa31c793c2bc06a9e1eba5a9a146b..a8258e2c8352255b6d954598c73c3dfda72b1749 100644 --- a/substrate/client/consensus/babe/src/lib.rs +++ b/substrate/client/consensus/babe/src/lib.rs @@ -1340,8 +1340,7 @@ where } let pre_digest = find_pre_digest::<Block>(&block.header).expect( - "valid babe headers must contain a predigest; \ - header has been already verified; qed", + "valid babe headers must contain a predigest; header has been already verified; qed", ); let slot = pre_digest.slot(); @@ -1357,8 +1356,8 @@ where })?; let parent_slot = find_pre_digest::<Block>(&parent_header).map(|d| d.slot()).expect( - "parent is non-genesis; valid BABE headers contain a pre-digest; \ - header has already been verified; qed", + "parent is non-genesis; valid BABE headers contain a pre-digest; header has already \ + been verified; qed", ); // make sure that slot number is strictly increasing @@ -1581,15 +1580,11 @@ where .header(BlockId::Hash(info.finalized_hash)) .map_err(|e| ConsensusError::ClientImport(format!("{:?}", e)))? .expect( - "best finalized hash was given by client; \ - finalized headers must exist in db; qed", + "best finalized hash was given by client; finalized headers must exist in db; qed", ); find_pre_digest::<Block>(&finalized_header) - .expect( - "finalized header must be valid; \ - valid blocks have a pre-digest; qed", - ) + .expect("finalized header must be valid; valid blocks have a pre-digest; qed") .slot() }; diff --git a/substrate/client/db/src/changes_tries_storage.rs b/substrate/client/db/src/changes_tries_storage.rs index 6b948a2d2c5c3161976ba08ed6eadc99901bc92a..a02e1cf7add98b3c91b55013a8188bdf8f62d61f 100644 --- a/substrate/client/db/src/changes_tries_storage.rs +++ b/substrate/client/db/src/changes_tries_storage.rs @@ -284,8 +284,8 @@ impl<Block: BlockT> DbChangesTrieStorage<Block> { pub fn post_commit(&self, tx: Option<DbChangesTrieStorageTransaction<Block>>) { if let Some(tx) = tx { self.cache.0.write().commit(tx.cache_ops).expect( - "only fails if cache with given name isn't loaded yet;\ - cache is already loaded because there is tx; qed", + "only fails if cache with given name isn't loaded yet; cache is already loaded \ + because there is tx; qed", ); } } diff --git a/substrate/client/db/src/light.rs b/substrate/client/db/src/light.rs index b1fff4f290664a6c308b8f34ef527948a5a011d2..0ad8224f02615b03ce98e722d87ef12a5ddc87ff 100644 --- a/substrate/client/db/src/light.rs +++ b/substrate/client/db/src/light.rs @@ -518,8 +518,8 @@ where self.db.commit(transaction)?; cache.commit(cache_ops).expect( - "only fails if cache with given name isn't loaded yet;\ - cache is already loaded because there are cache_ops; qed", + "only fails if cache with given name isn't loaded yet; cache is already loaded \ + because there are cache_ops; qed", ); } @@ -569,8 +569,8 @@ where self.db.commit(transaction)?; cache.commit(cache_ops).expect( - "only fails if cache with given name isn't loaded yet;\ - cache is already loaded because there are cache_ops; qed", + "only fails if cache with given name isn't loaded yet; cache is already loaded \ + because there are cache_ops; qed", ); } self.update_meta(hash, header.number().clone(), false, true); diff --git a/substrate/client/executor/runtime-test/src/lib.rs b/substrate/client/executor/runtime-test/src/lib.rs index 11771b183e3c4ceedda33b2b384c859e92eb3422..c9f7d6b1e2970282e3f0a45ee96c91712b40bdf2 100644 --- a/substrate/client/executor/runtime-test/src/lib.rs +++ b/substrate/client/executor/runtime-test/src/lib.rs @@ -8,8 +8,8 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] { WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only \ - supported with the flag disabled.", + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", ) } diff --git a/substrate/client/finality-grandpa/src/lib.rs b/substrate/client/finality-grandpa/src/lib.rs index 58e7ba1493e8aaf8bd9bdbd068859ea1d69b77e1..1e34202ef8f9987afddd11afb2523d35f242d8ae 100644 --- a/substrate/client/finality-grandpa/src/lib.rs +++ b/substrate/client/finality-grandpa/src/lib.rs @@ -1016,10 +1016,9 @@ where })?; let voters = Arc::new(VoterSet::new(new.authorities.into_iter()).expect( - "new authorities come from pending change; \ - pending change comes from `AuthoritySet`; \ - `AuthoritySet` validates authorities is non-empty and weights are non-zero; \ - qed.", + "new authorities come from pending change; pending change comes from \ + `AuthoritySet`; `AuthoritySet` validates authorities is non-empty and \ + weights are non-zero; qed.", )); self.env = Arc::new(Environment { diff --git a/substrate/client/network/src/discovery.rs b/substrate/client/network/src/discovery.rs index da50ded077d5ef19cac13d06cb363b6531a1a31b..6ca01cd89219230ff6bee7f3165ccd0a0ca82274 100644 --- a/substrate/client/network/src/discovery.rs +++ b/substrate/client/network/src/discovery.rs @@ -485,11 +485,10 @@ impl NetworkBehaviour for DiscoveryBehaviour { .map(|(p, k)| (p.clone(), NetworkBehaviour::new_handler(k))); IntoMultiHandler::try_from_iter(iter).expect( - "There can be at most one handler per `ProtocolId` and \ - protocol names contain the `ProtocolId` so no two protocol \ - names in `self.kademlias` can be equal which is the only error \ - `try_from_iter` can return, therefore this call is guaranteed \ - to succeed; qed", + "There can be at most one handler per `ProtocolId` and protocol names contain the \ + `ProtocolId` so no two protocol names in `self.kademlias` can be equal which is the \ + only error `try_from_iter` can return, therefore this call is guaranteed to succeed; \ + qed", ) } diff --git a/substrate/client/network/src/request_responses.rs b/substrate/client/network/src/request_responses.rs index 226e1c546d6c971f86595a7b8128758cb42680c1..bd20f1610d1ace5b57bb162023182f976310cad2 100644 --- a/substrate/client/network/src/request_responses.rs +++ b/substrate/client/network/src/request_responses.rs @@ -364,8 +364,8 @@ impl NetworkBehaviour for RequestResponsesBehaviour { .map(|(p, (r, _))| (p.to_string(), NetworkBehaviour::new_handler(r))); MultiHandler::try_from_iter(iter).expect( - "Protocols are in a HashMap and there can be at most one handler per \ - protocol name, which is the only possible error; qed", + "Protocols are in a HashMap and there can be at most one handler per protocol name, \ + which is the only possible error; qed", ) } diff --git a/substrate/client/service/src/client/client.rs b/substrate/client/service/src/client/client.rs index 1e5e2841619194f0e4b2b52c29b2cd5d82a23a88..901321f395bf5300b056b32e6be8f7d6b6d3e20c 100644 --- a/substrate/client/service/src/client/client.rs +++ b/substrate/client/service/src/client/client.rs @@ -1072,8 +1072,8 @@ where // telemetry once about the finalized block. if let Some(last) = notify_finalized.last() { let header = self.header(&BlockId::Hash(*last))?.expect( - "Header already known to exist in DB because it is \ - indicated in the tree route; qed", + "Header already known to exist in DB because it is indicated in the tree route; \ + qed", ); telemetry!( @@ -1087,8 +1087,8 @@ where for finalized_hash in notify_finalized { let header = self.header(&BlockId::Hash(finalized_hash))?.expect( - "Header already known to exist in DB because it is \ - indicated in the tree route; qed", + "Header already known to exist in DB because it is indicated in the tree route; \ + qed", ); let notification = FinalityNotification { header, hash: finalized_hash }; diff --git a/substrate/frame/staking/reward-curve/src/lib.rs b/substrate/frame/staking/reward-curve/src/lib.rs index 076c3682ab411fca872745c5a696716bed5a4c13..22ddc817091c37c6a915b8363312113d67555e8d 100644 --- a/substrate/frame/staking/reward-curve/src/lib.rs +++ b/substrate/frame/staking/reward-curve/src/lib.rs @@ -353,8 +353,8 @@ fn generate_piecewise_linear(points: Vec<(u32, u32)>) -> TokenStream2 { for (x, y) in points { let error = || { panic!( - "Generated reward curve approximation doesn't fit into [0, 1] -> [0, 1] \ - because of point: + "Generated reward curve approximation doesn't fit into [0, 1] -> [0, 1] because \ + of point: x = {:07} per million y = {:07} per million", x, y diff --git a/substrate/primitives/npos-elections/src/balancing.rs b/substrate/primitives/npos-elections/src/balancing.rs index 378ebe8e84fd1f38bb65efa8986013035c274aa9..63164049e526954bda132faacc3992e71eadcec7 100644 --- a/substrate/primitives/npos-elections/src/balancing.rs +++ b/substrate/primitives/npos-elections/src/balancing.rs @@ -157,8 +157,8 @@ pub(crate) fn balance_voter<AccountId: IdentifierT>( let last_stake = elected_edges .get(last_index) .expect( - "length of elected_edges is greater than or equal 2; last_index index is at \ - the minimum elected_edges.len() - 1; index is within range; qed", + "length of elected_edges is greater than or equal 2; last_index index is at the \ + minimum elected_edges.len() - 1; index is within range; qed", ) .candidate .borrow() diff --git a/substrate/primitives/runtime-interface/test-wasm-deprecated/src/lib.rs b/substrate/primitives/runtime-interface/test-wasm-deprecated/src/lib.rs index 8c864fc90e0363ce7ddc1ce2288e684f30fe5f9b..4a59e4fe8aa5ff83b904a2d78b17b07045cce05e 100644 --- a/substrate/primitives/runtime-interface/test-wasm-deprecated/src/lib.rs +++ b/substrate/primitives/runtime-interface/test-wasm-deprecated/src/lib.rs @@ -30,8 +30,8 @@ include!(concat!(env!("OUT_DIR"), "/wasm_binary.rs")); #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] { WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only \ - supported with the flag disabled.", + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", ) } diff --git a/substrate/test-utils/runtime/src/lib.rs b/substrate/test-utils/runtime/src/lib.rs index 62aa28d4260ac8bbc0c37569e47bde6497874ca2..8da8f5c5db4e35c32f5469c52c16479313a29151 100644 --- a/substrate/test-utils/runtime/src/lib.rs +++ b/substrate/test-utils/runtime/src/lib.rs @@ -76,8 +76,8 @@ pub mod wasm_binary_logging_disabled { #[cfg(feature = "std")] pub fn wasm_binary_unwrap() -> &'static [u8] { WASM_BINARY.expect( - "Development wasm binary is not available. Testing is only \ - supported with the flag disabled.", + "Development wasm binary is not available. Testing is only supported with the flag \ + disabled.", ) } @@ -86,7 +86,7 @@ pub fn wasm_binary_unwrap() -> &'static [u8] { pub fn wasm_binary_logging_disabled_unwrap() -> &'static [u8] { wasm_binary_logging_disabled::WASM_BINARY.expect( "Development wasm binary is not available. Testing is only supported with the flag \ - disabled.", + disabled.", ) }