From 3481551926ea2fbbb336dbb426d707ebd9637850 Mon Sep 17 00:00:00 2001 From: Jeff Date: Mon, 28 Aug 2023 13:47:45 -0400 Subject: [PATCH] Run clippy --fix --- src/tools/collections.rs | 2 +- src/tools/gui.rs | 2 +- src/value/mod.rs | 2 +- src/value/value_type.rs | 7 +------ 4 files changed, 4 insertions(+), 9 deletions(-) diff --git a/src/tools/collections.rs b/src/tools/collections.rs index 92f2d16..0cb6ff8 100644 --- a/src/tools/collections.rs +++ b/src/tools/collections.rs @@ -64,7 +64,7 @@ impl Tool for Transform { mapped_list.push(mapped_value); } - return Ok(Value::List(mapped_list)); + Ok(Value::List(mapped_list)) } } diff --git a/src/tools/gui.rs b/src/tools/gui.rs index 1de3ee5..077d6b8 100644 --- a/src/tools/gui.rs +++ b/src/tools/gui.rs @@ -29,7 +29,7 @@ impl Tool for BarGraph { let argument = argument.as_list()?; let mut bars = Vec::new(); - for (index, value) in argument.into_iter().enumerate() { + for (index, value) in argument.iter().enumerate() { let list = value.as_list()?; let mut name = None; let mut height = None; diff --git a/src/value/mod.rs b/src/value/mod.rs index d729f4b..4b981d6 100644 --- a/src/value/mod.rs +++ b/src/value/mod.rs @@ -518,7 +518,7 @@ impl<'de> Visitor<'de> for ValueVisitor { where E: serde::de::Error, { - Ok(Value::Integer(v as i64)) + Ok(Value::Integer(v)) } fn visit_i128(self, v: i128) -> std::result::Result diff --git a/src/value/value_type.rs b/src/value/value_type.rs index 0429cac..dee3760 100644 --- a/src/value/value_type.rs +++ b/src/value/value_type.rs @@ -39,14 +39,9 @@ impl PartialEq for ValueType { (ValueType::List, ValueType::ListOf(_)) => true, (ValueType::ListOf(value_type), ValueType::ListExact(exact_list)) | (ValueType::ListExact(exact_list), ValueType::ListOf(value_type)) => { - if exact_list + exact_list .iter() .all(|exact_type| exact_type == value_type.as_ref()) - { - true - } else { - false - } } (ValueType::List, ValueType::List) => true, (ValueType::Empty, ValueType::Empty) => true,