Compare commits
No commits in common. "main" and "refactor" have entirely different histories.
3 changed files with 1 additions and 5 deletions
|
@ -36,7 +36,5 @@ Install the package using Cargo with the command <code>cargo install quickmath</
|
|||
## Libraries
|
||||
|
||||
- [evalexpr](https://crates.io/crates/evalexpr) — expression evaluator
|
||||
- [pico-args](https://crates.io/crates/pico_args) — argument parsing
|
||||
- [rustyline](https://crates.io/crates/rustyline) — input handler
|
||||
- [termion](https://crates.io/crates/termion) — ANSI formatting
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ pub fn logarithm(arg: &Value) -> EvalResult {
|
|||
Value::Tuple(tuple)
|
||||
=> {
|
||||
let len = tuple.len();
|
||||
if len != 2 { return Err(EvalexprError::wrong_function_argument_amount_range(len, 1..=2)); }
|
||||
if len != 2 { return Err(EvalexprError::WrongOperatorArgumentAmount { expected: 2, actual: len }) }
|
||||
|
||||
let i_value = tuple.get(0).unwrap();
|
||||
if let Value::Float(float) = i_value { value = float.clone(); }
|
||||
|
|
|
@ -14,7 +14,6 @@ use std::{
|
|||
use evalexpr::{
|
||||
eval_with_context_mut,
|
||||
|
||||
ContextWithMutableVariables,
|
||||
EvalexprError,
|
||||
HashMapContext,
|
||||
Value
|
||||
|
@ -84,7 +83,6 @@ fn main() {
|
|||
|
||||
fn eval(expression: &str, context: &mut HashMapContext, quiet: bool) {
|
||||
let result = eval_with_context_mut(expression, context);
|
||||
|
||||
if quiet {
|
||||
if let Ok(result) = result { println!("{result}") }
|
||||
else { exit(1) }
|
||||
|
|
Loading…
Reference in a new issue