refactor(eval): rename math_constants to constants
This commit is contained in:
3 files changed
+3
-3
No files matched your search
File renamed without changes.
+2
-2
@@ -1,7 +1,7 @@
|
||||
use rust_decimal::MathematicalOps;
|
||||
|
||||
use crate::math::{
|
||||
functions, math_constants,
|
||||
constants, functions,
|
||||
types::{Expression, Operator},
|
||||
};
|
||||
|
||||
@@ -9,7 +9,7 @@ pub fn eval_expr(expr: Expression) -> Expression {
|
||||
match expr {
|
||||
Expression::Number(_) => expr,
|
||||
Expression::Variable(name) => {
|
||||
if let Some(value) = math_constants::get(&name) {
|
||||
if let Some(value) = constants::get(&name) {
|
||||
Expression::Number(value)
|
||||
} else {
|
||||
Expression::Variable(name)
|
||||
|
||||
+1
-1
@@ -3,11 +3,11 @@ use crate::math::types::Expression;
|
||||
#[cfg(test)]
|
||||
mod tests;
|
||||
|
||||
mod constants;
|
||||
mod display;
|
||||
mod eval;
|
||||
mod functions;
|
||||
mod lexer;
|
||||
mod math_constants;
|
||||
mod parser;
|
||||
|
||||
pub mod types;
|
||||
|
||||
Reference in new issue
Block a user