diff options
| author | Sam Anthony <sam@samanthony.xyz> | 2023-02-09 11:54:34 -0330 |
|---|---|---|
| committer | Sam Anthony <sam@samanthony.xyz> | 2023-02-09 11:54:34 -0330 |
| commit | 9c04c7b1f8d6911b5a148398d5b4ab416f2136f5 (patch) | |
| tree | 139e7cdd00df88929923c17707ce8652d208e674 | |
| parent | 33181c5a3c7e6e7a3977075ec9d7d0e40cc6da94 (diff) | |
| download | pfc-9c04c7b1f8d6911b5a148398d5b4ab416f2136f5.zip | |
change order of match
| -rw-r--r-- | src/input.rs | 6 |
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(); - } _ => {} }, _ => {} |