From 1c6d8a90d4a36c765637e88c9b0324605642e701 Mon Sep 17 00:00:00 2001 From: Julius de Jeu Date: Sun, 3 Jul 2022 23:16:35 +0200 Subject: [PATCH] Fix clippy errors --- src/env.rs | 6 ++++++ src/pest_parser.rs | 2 +- src/value/custom.rs | 8 -------- 3 files changed, 7 insertions(+), 9 deletions(-) diff --git a/src/env.rs b/src/env.rs index e6911b1..129cebb 100644 --- a/src/env.rs +++ b/src/env.rs @@ -49,6 +49,12 @@ impl Env<'_> { } } +impl Default for Env<'_> { + fn default() -> Self { + Self::new() + } +} + impl<'env> Env<'env> { pub fn new_with_parent(parent: &'env Env<'env>) -> Self { Env { diff --git a/src/pest_parser.rs b/src/pest_parser.rs index 220dcdf..eeb1599 100644 --- a/src/pest_parser.rs +++ b/src/pest_parser.rs @@ -69,7 +69,7 @@ fn handle_rules(mut p: pest::iterators::Pairs) -> (Statement, FuncHolder) ) } Rule::if_block => { - let mut inner = pair.into_inner().into_iter(); + let mut inner = pair.into_inner(); let mut the_list = vec![]; let mut the_else = None; while let Some(expr) = inner.next() { diff --git a/src/value/custom.rs b/src/value/custom.rs index 2f5829f..ddadb8b 100644 --- a/src/value/custom.rs +++ b/src/value/custom.rs @@ -23,10 +23,6 @@ pub trait CustomValue: std::fmt::Debug + BoxClone { false } - fn ne(&self, other: &Value) -> bool { - !self.eq(other) - } - fn partial_cmp(&self, _: &Value) -> Option { None } @@ -40,10 +36,6 @@ impl PartialEq for dyn CustomValue { fn eq(&self, other: &Value) -> bool { self.eq(other) } - - fn ne(&self, other: &Value) -> bool { - self.ne(other) - } } impl PartialOrd for dyn CustomValue {