From 9c04c7b1f8d6911b5a148398d5b4ab416f2136f5 Mon Sep 17 00:00:00 2001 From: Sam Anthony Date: Thu, 9 Feb 2023 11:54:34 -0330 Subject: change order of match --- src/input.rs | 6 +++--- 1 file 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(); - } _ => {} }, _ => {} -- cgit v1.2.3