aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/input.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/input.rs b/src/input.rs
index ac5c5c8..a80ce11 100644
--- a/src/input.rs
+++ b/src/input.rs
@@ -27,6 +27,9 @@ impl Calculator {
self.input_buffer = String::new();
}
KeyCode::Char(c) => self.push_to_buffer(c),
+ KeyCode::Backspace => {
+ self.input_buffer.pop();
+ }
KeyCode::Enter if self.input_buffer.len() > 0 => {
if let Ok(func) = Function::parse(&self.input_buffer) {
if let Some(f) = self.stack.pop() {
@@ -37,9 +40,6 @@ impl Calculator {
}
self.input_buffer = String::new();
}
- KeyCode::Backspace => {
- self.input_buffer.pop();
- }
_ => {}
},
_ => {}