From ce5a8760c1202e4461b44f0ae4f1fa6864edd7ed Mon Sep 17 00:00:00 2001 From: brevalferrari Date: Wed, 28 May 2025 13:29:06 +0200 Subject: [PATCH] clippy --- src/compiler.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/compiler.rs b/src/compiler.rs index 3f20111..72eecbe 100644 --- a/src/compiler.rs +++ b/src/compiler.rs @@ -227,7 +227,7 @@ impl Clone for Expression { fn clone(&self) -> Self { self.from .parse() - .expect(&format!("expression {self:?} have an invalid from")) + .unwrap_or_else(|_| panic!("expression {self:?} have an invalid from")) } } @@ -316,7 +316,7 @@ impl Context { .filter_map(|(c, e)| (c == &var).then_some(e)) .collect(); if result.is_empty() { - return Err(SlopeNotFoundError(var)); + Err(SlopeNotFoundError(var)) } else { Ok(result) } @@ -379,7 +379,7 @@ impl Context { }: &Expression, ns: &mut impl EvalNamespace, ) -> Result { - instruction.eval(&slab, ns) + instruction.eval(slab, ns) } pub fn render(&mut self, n: Option) -> Result, CompilerError> { @@ -417,7 +417,7 @@ impl Compiler { fn step(self, token: impl Token) -> Result { token.apply(self.0).map(Into::into) } - fn compile_all<'a>( + fn compile_all( self, tokens: impl IntoIterator, ) -> Result, CompilerError> {