diff options
Diffstat (limited to 'src/main.rs')
-rw-r--r-- | src/main.rs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs index bc22ce2..7086d15 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -193,7 +193,9 @@ fn parse_arguments() -> Configuration { | |||
193 | 193 | ||
194 | pub fn eval_math_expression(input: &str, prev_ans: Option<f64>) -> Result<f64, CalcError> { | 194 | pub fn eval_math_expression(input: &str, prev_ans: Option<f64>) -> Result<f64, CalcError> { |
195 | let input = input.trim(); | 195 | let input = input.trim(); |
196 | let input = input.replace(" ", ""); | 196 | if input == "help" { |
197 | return Err(CalcError::Help); | ||
198 | } | ||
197 | if input.is_empty() { | 199 | if input.is_empty() { |
198 | return Ok(0.); | 200 | return Ok(0.); |
199 | } | 201 | } |