This commit is contained in:
brevalferrari 2025-05-28 13:29:06 +02:00
parent 73fb1d52b5
commit ce5a8760c1

View file

@ -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<f64, fasteval::Error> {
instruction.eval(&slab, ns)
instruction.eval(slab, ns)
}
pub fn render(&mut self, n: Option<u8>) -> Result<Vec<f64>, CompilerError> {
@ -417,7 +417,7 @@ impl Compiler {
fn step(self, token: impl Token) -> Result<Self, CompilerError> {
token.apply(self.0).map(Into::into)
}
fn compile_all<'a>(
fn compile_all(
self,
tokens: impl IntoIterator<Item = impl Token>,
) -> Result<Vec<f64>, CompilerError> {