diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/error.rs (renamed from src/error/mod.rs) | 0 | ||||
-rw-r--r-- | src/format.rs (renamed from src/format/mod.rs) | 0 | ||||
-rw-r--r-- | src/lex.rs (renamed from src/lex/mod.rs) | 3 | ||||
-rw-r--r-- | src/main.rs | 3 | ||||
-rw-r--r-- | src/parse.rs (renamed from src/parse/mod.rs) | 0 | ||||
-rw-r--r-- | src/readline.rs (renamed from src/readline/mod.rs) | 0 |
6 files changed, 2 insertions, 4 deletions
diff --git a/src/error/mod.rs b/src/error.rs index ec2b555..ec2b555 100644 --- a/src/error/mod.rs +++ b/src/error.rs | |||
diff --git a/src/format/mod.rs b/src/format.rs index 45673d7..45673d7 100644 --- a/src/format/mod.rs +++ b/src/format.rs | |||
diff --git a/src/lex/mod.rs b/src/lex.rs index 3222c12..a2de98a 100644 --- a/src/lex/mod.rs +++ b/src/lex.rs | |||
@@ -5,9 +5,8 @@ | |||
5 | use lazy_static::lazy_static; | 5 | use lazy_static::lazy_static; |
6 | use std::collections::HashMap; | 6 | use std::collections::HashMap; |
7 | 7 | ||
8 | use crate::CONFIGURATION; | ||
9 | |||
10 | use crate::error::{CalcError, Math}; | 8 | use crate::error::{CalcError, Math}; |
9 | use crate::CONFIGURATION; | ||
11 | 10 | ||
12 | #[derive(Debug, Copy, Clone, PartialEq)] | 11 | #[derive(Debug, Copy, Clone, PartialEq)] |
13 | pub struct Operator { | 12 | pub struct Operator { |
diff --git a/src/main.rs b/src/main.rs index bc22ce2..5540da9 100644 --- a/src/main.rs +++ b/src/main.rs | |||
@@ -192,8 +192,7 @@ fn parse_arguments() -> Configuration { | |||
192 | } | 192 | } |
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().replace(" ", ""); |
196 | let input = input.replace(" ", ""); | ||
197 | if input.is_empty() { | 196 | if input.is_empty() { |
198 | return Ok(0.); | 197 | return Ok(0.); |
199 | } | 198 | } |
diff --git a/src/parse/mod.rs b/src/parse.rs index aa8bd4b..aa8bd4b 100644 --- a/src/parse/mod.rs +++ b/src/parse.rs | |||
diff --git a/src/readline/mod.rs b/src/readline.rs index ea195ee..ea195ee 100644 --- a/src/readline/mod.rs +++ b/src/readline.rs | |||