From 77a8d0bbfcdaecc9233c1384ae98a3de91e639d2 Mon Sep 17 00:00:00 2001 From: librelois <c@elo.tf> Date: Fri, 13 May 2022 02:06:52 +0200 Subject: [PATCH] style: remove xtask warnings (rustc and clippy) --- xtask/src/gen_calls_doc.rs | 16 +++------------- xtask/src/main.rs | 2 +- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/xtask/src/gen_calls_doc.rs b/xtask/src/gen_calls_doc.rs index 87c795fde..3f4380fb6 100644 --- a/xtask/src/gen_calls_doc.rs +++ b/xtask/src/gen_calls_doc.rs @@ -14,7 +14,7 @@ // You should have received a copy of the GNU Affero General Public License // along with Substrate-Libre-Currency. If not, see <https://www.gnu.org/licenses/>. -use anyhow::{anyhow, bail, Context, Result}; +use anyhow::{bail, Context, Result}; use codec::Decode; use scale_info::form::PortableForm; use std::{ @@ -70,18 +70,10 @@ impl CallCategory { } } fn is_root(pallet_name: &str, call_name: &str) -> bool { - if let Self::Root = Self::is(pallet_name, call_name) { - true - } else { - false - } + matches!(Self::is(pallet_name, call_name), Self::Root) } fn is_user(pallet_name: &str, call_name: &str) -> bool { - if let Self::User = Self::is(pallet_name, call_name) { - true - } else { - false - } + matches!(Self::is(pallet_name, call_name), Self::User) } } @@ -131,7 +123,6 @@ impl From<&scale_info::Variant<PortableForm>> for Call { #[derive(Clone)] struct CallParam { - docs: Vec<String>, name: String, type_name: String, } @@ -139,7 +130,6 @@ struct CallParam { impl From<&scale_info::Field<PortableForm>> for CallParam { fn from(field: &scale_info::Field<PortableForm>) -> Self { Self { - docs: field.docs().to_vec(), name: field.name().cloned().unwrap_or_default(), type_name: field.type_name().cloned().unwrap_or_default(), } diff --git a/xtask/src/main.rs b/xtask/src/main.rs index 56a0573c3..0873750f8 100644 --- a/xtask/src/main.rs +++ b/xtask/src/main.rs @@ -64,7 +64,7 @@ fn main() -> Result<()> { } } -fn build(production: bool) -> Result<()> { +fn build(_production: bool) -> Result<()> { exec_should_success(Command::new("cargo").args(&["clean", "-p", "duniter"]))?; exec_should_success(Command::new("cargo").args(&["build", "--locked"]))?; exec_should_success(Command::new("mkdir").args(&["build"]))?; -- GitLab