aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main.rs b/src/main.rs
index 5b7fdb4..75c33bb 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -193,8 +193,10 @@ fn parse_arguments() -> Configuration {
193} 193}
194 194
195pub fn eval_math_expression(input: &str, prev_ans: Option<f64>) -> Result<f64, CalcError> { 195pub fn eval_math_expression(input: &str, prev_ans: Option<f64>) -> Result<f64, CalcError> {
196 let input = input.trim(); 196 let input = input.trim().replace(" ", "");
197 let input = input.replace(" ", ""); 197 if input == "help" {
198 return Err(CalcError::Help);
199 }
198 if input.is_empty() { 200 if input.is_empty() {
199 return Ok(0.); 201 return Ok(0.);
200 } 202 }