From 6b9bf55ac3ddff5d4a6cf38389acaa2fd0ac8ae6 Mon Sep 17 00:00:00 2001 From: Hugo Trentesaux <hugo@trentesaux.fr> Date: Sat, 3 Jun 2023 23:27:31 +0200 Subject: [PATCH] clippy --- src/commands/revocation.rs | 2 +- src/commands/runtime.rs | 2 +- src/data.rs | 10 ++++++---- 3 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/commands/revocation.rs b/src/commands/revocation.rs index 95e1368..2052188 100644 --- a/src/commands/revocation.rs +++ b/src/commands/revocation.rs @@ -6,7 +6,7 @@ use sp_core::sr25519::Signature; // use crate::runtime::runtime_types::pallet_identity::types::RevocationPayload; type EncodedRevocationPayload = Vec<u8>; -pub fn print_revoc_sig(data: &Data) -> () { +pub fn print_revoc_sig(data: &Data) { let (_, signature) = generate_revoc_doc(data); println!("revocation payload signature"); println!("0x{}", hex::encode(signature)); diff --git a/src/commands/runtime.rs b/src/commands/runtime.rs index 8238d8c..2f51e6f 100644 --- a/src/commands/runtime.rs +++ b/src/commands/runtime.rs @@ -1,6 +1,6 @@ use crate::*; -pub async fn runtime_info(data: Data) -> () { +pub async fn runtime_info(data: Data) { let api = data.client(); // certifications diff --git a/src/data.rs b/src/data.rs index 8639b9d..80ee1e0 100644 --- a/src/data.rs +++ b/src/data.rs @@ -103,10 +103,12 @@ impl Data { /// build a client from url // TODO get client from a pre-defined list pub async fn build_client(mut self) -> Self { - self.client = Some(Client::from_url(&self.args.url).await.expect(&format!( - "could not establish connection with the server {}", - self.args.url - ))); + self.client = Some(Client::from_url(&self.args.url).await.unwrap_or_else(|_| { + panic!( + "could not establish connection with the server {}", + self.args.url + ) + })); self } /// build an indexer if not disabled -- GitLab