diff --git a/src/formatting.rs b/src/formatting.rs index e20e378..c784145 100644 --- a/src/formatting.rs +++ b/src/formatting.rs @@ -1,8 +1,6 @@ -use std::str::FromStr; - use rug::Float; -use crate::nodes::{Error, Nodes}; +use crate::nodes::{self, Error}; pub fn pretty_eval(mut input: String) -> Result { // no need to remove the characters here, @@ -18,7 +16,7 @@ pub fn pretty_eval(mut input: String) -> Result { }) .is_some(); - let result = Nodes::from_str(&input)?.evaluate()?; + let result = nodes::eval(&input)?; let significant_digits = get_significant_digits(&result); Ok(format!(