From 3d67c2290524b68abcb5fa9ed6b9c6f32548075b Mon Sep 17 00:00:00 2001 From: electria Date: Wed, 30 Sep 2026 19:51:41 -0700 Subject: [PATCH] refactor: use nodes::eval helper in formatting this also silences the corresponding dead_code warning with bin builds --- src/formatting.rs | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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!(