fixes for nightly clippy (#1618)

This commit is contained in:
Svyatoslav Nikolsky
2022-10-28 11:46:40 +03:00
committed by Bastian Köcher
parent 9592b55fea
commit f58e076ca2
22 changed files with 45 additions and 45 deletions
+2 -2
View File
@@ -56,7 +56,7 @@ pub enum Alternative {
/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
TPublic::Pair::from_string(&format!("//{seed}"), None)
.expect("static values are valid; qed")
.public()
}
@@ -150,7 +150,7 @@ fn endowed_accounts() -> Vec<AccountId> {
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
[
get_account_id_from_seed::<sr25519::Public>(x),
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
get_account_id_from_seed::<sr25519::Public>(&format!("{x}//stash")),
]
});
vec![
+1 -1
View File
@@ -62,7 +62,7 @@ impl SubstrateCli for Cli {
match id {
"" | "dev" => crate::chain_spec::Alternative::Development,
"local" => crate::chain_spec::Alternative::LocalTestnet,
_ => return Err(format!("Unsupported chain specification: {}", id)),
_ => return Err(format!("Unsupported chain specification: {id}")),
}
.load(),
))
+2 -2
View File
@@ -293,7 +293,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
Box::new(move |_, subscription_executor: sc_rpc::SubscriptionTaskExecutor| {
let mut io = RpcModule::new(());
let map_err = |e| sc_service::Error::Other(format!("{}", e));
let map_err = |e| sc_service::Error::Other(format!("{e}"));
io.merge(System::new(client.clone(), pool.clone(), DenyUnsafe::No).into_rpc())
.map_err(map_err)?;
io.merge(TransactionPayment::new(client.clone()).into_rpc()).map_err(map_err)?;
@@ -314,7 +314,7 @@ pub fn new_full(mut config: Configuration) -> Result<TaskManager, ServiceError>
beefy_rpc_links.from_voter_best_beefy_stream.clone(),
subscription_executor,
)
.map_err(|e| sc_service::Error::Other(format!("{}", e)))?
.map_err(|e| sc_service::Error::Other(format!("{e}")))?
.into_rpc(),
)
.map_err(map_err)?;
@@ -39,7 +39,7 @@ pub type ChainSpec =
/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
TPublic::Pair::from_string(&format!("//{seed}"), None)
.expect("static values are valid; qed")
.public()
}
@@ -81,7 +81,7 @@ fn endowed_accounts() -> Vec<AccountId> {
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
[
get_account_id_from_seed::<sr25519::Public>(x),
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
get_account_id_from_seed::<sr25519::Public>(&format!("{x}//stash")),
]
});
vec![
@@ -196,7 +196,7 @@ pub fn run() -> Result<()> {
&polkadot_cli,
config.tokio_handle.clone(),
)
.map_err(|err| format!("Relay chain argument error: {}", err))?;
.map_err(|err| format!("Relay chain argument error: {err}"))?;
cmd.run(config, polkadot_config)
})
@@ -292,7 +292,7 @@ pub fn run() -> Result<()> {
let state_version =
RelayChainCli::native_runtime_version(&config.chain_spec).state_version();
let block: Block = generate_genesis_block(&*config.chain_spec, state_version)
.map_err(|e| format!("{:?}", e))?;
.map_err(|e| format!("{e:?}"))?;
let genesis_state = format!("0x{:?}", HexDisplay::from(&block.header().encode()));
let polkadot_config = SubstrateCli::create_configuration(
@@ -300,7 +300,7 @@ pub fn run() -> Result<()> {
&polkadot_cli,
config.tokio_handle.clone(),
)
.map_err(|err| format!("Relay chain argument error: {}", err))?;
.map_err(|err| format!("Relay chain argument error: {err}"))?;
info!("Parachain id: {:?}", id);
info!("Parachain Account: {}", parachain_account);
@@ -443,7 +443,7 @@ pub async fn start_node(
use substrate_frame_rpc_system::{System, SystemApiServer};
let mut io = jsonrpsee::RpcModule::new(());
let map_err = |e| sc_service::Error::Other(format!("{}", e));
let map_err = |e| sc_service::Error::Other(format!("{e}"));
io.merge(System::new(client.clone(), pool, DenyUnsafe::No).into_rpc())
.map_err(map_err)?;
io.merge(TransactionPayment::new(client).into_rpc()).map_err(map_err)?;
+2 -2
View File
@@ -57,7 +57,7 @@ pub enum Alternative {
/// Helper function to generate a crypto pair from seed
pub fn get_from_seed<TPublic: Public>(seed: &str) -> <TPublic::Pair as Pair>::Public {
TPublic::Pair::from_string(&format!("//{}", seed), None)
TPublic::Pair::from_string(&format!("//{seed}"), None)
.expect("static values are valid; qed")
.public()
}
@@ -156,7 +156,7 @@ fn endowed_accounts() -> Vec<AccountId> {
let all_authorities = ALL_AUTHORITIES_ACCOUNTS.iter().flat_map(|x| {
[
get_account_id_from_seed::<sr25519::Public>(x),
get_account_id_from_seed::<sr25519::Public>(&format!("{}//stash", x)),
get_account_id_from_seed::<sr25519::Public>(&format!("{x}//stash")),
]
});
vec![
+1 -1
View File
@@ -57,7 +57,7 @@ impl SubstrateCli for Cli {
match id {
"" | "dev" => crate::chain_spec::Alternative::Development,
"local" => crate::chain_spec::Alternative::LocalTestnet,
_ => return Err(format!("Unsupported chain specification: {}", id)),
_ => return Err(format!("Unsupported chain specification: {id}")),
}
.load(),
))