From d0547ba2e401e07f91e08a32473129d9dddd8999 Mon Sep 17 00:00:00 2001 From: cgeek <cem.moreau@gmail.com> Date: Wed, 18 Oct 2023 13:07:17 +0200 Subject: [PATCH] fix(#125): fix: clippy --- end2end-tests/tests/common/cert.rs | 4 ++-- node/src/chain_spec/gen_genesis_data.rs | 9 ++++----- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/end2end-tests/tests/common/cert.rs b/end2end-tests/tests/common/cert.rs index 0b93cb0b6..d8ae5e027 100644 --- a/end2end-tests/tests/common/cert.rs +++ b/end2end-tests/tests/common/cert.rs @@ -29,12 +29,12 @@ pub async fn certify(client: &Client, from: AccountKeyring, to: AccountKeyring) .storage() .fetch(&gdev::storage().identity().identity_index_of(&from), None) .await? - .expect(format!("{} issuer must exist", from.to_string()).as_str()); + .unwrap_or_else(|| panic!("{} issuer must exist", from)); let receiver_index = client .storage() .fetch(&gdev::storage().identity().identity_index_of(&to), None) .await? - .expect(format!("{} issuer must exist", from.to_string()).as_str()); + .unwrap_or_else(|| panic!("{} issuer must exist", from)); let _events = create_block_with_extrinsic( client, diff --git a/node/src/chain_spec/gen_genesis_data.rs b/node/src/chain_spec/gen_genesis_data.rs index 04833705b..2ed46474a 100644 --- a/node/src/chain_spec/gen_genesis_data.rs +++ b/node/src/chain_spec/gen_genesis_data.rs @@ -318,10 +318,9 @@ where .expect("a G1 identity necessarily has a valid pubkey") }) .unwrap_or_else(|| { - i.owner_address.expect( - format!("neither pubkey nor address is defined for {}", name) - .as_str(), - ) + i.owner_address.unwrap_or_else(|| { + panic!("neither pubkey nor address is defined for {}", name) + }) }), old_owner_key: None, membership_expire_on: timestamp_to_relative_blocs( @@ -458,7 +457,7 @@ where authority.certs_received.insert(issuer, c); }); let sk: SessionKeys = SKP::session_keys(&get_authority_keys_from_seed(name.as_str())); - let forced_authority_session_keys = format!("0x{}", hex::encode(sk.encode())).to_string(); + let forced_authority_session_keys = format!("0x{}", hex::encode(sk.encode())); // Add forced authority to smiths (whether explicit smith WoT or clique) if let Some(smith_identities) = &mut smith_identities { smith_identities.insert( -- GitLab