From 582351d837cb25680a3d7ae7345cf82479a3adf8 Mon Sep 17 00:00:00 2001 From: iximeow Date: Sun, 15 Oct 2017 03:30:52 -0700 Subject: fix bug in address dialog not going away immediately --- main.rs | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/main.rs b/main.rs index e47efda..9792daf 100644 --- a/main.rs +++ b/main.rs @@ -531,27 +531,27 @@ fn interface_loop(state: &mut Program) { state.input_buf = Vec::with_capacity(0); state.state = Mode::Edit; state.status = " ".to_string(); - continue; - } - let addr_str = u64::from_str_radix(&buf_str, 16); - match addr_str { - Ok(addr) => { - if addr < state.view.size() { - state.seek_to(addr); - state.input_buf = Vec::with_capacity(0); - state.state = Mode::Edit; - state.status = " ".to_string(); - } else { - state.status = format!("Address out of bounds: 0x{:x}", addr); + } else { + let addr_str = u64::from_str_radix(&buf_str, 16); + match addr_str { + Ok(addr) => { + if addr < state.view.size() { + state.seek_to(addr); + state.input_buf = Vec::with_capacity(0); + state.state = Mode::Edit; + state.status = " ".to_string(); + } else { + state.status = format!("Address out of bounds: 0x{:x}", addr); + state.input_buf = Vec::with_capacity(0); + state.state = Mode::Edit; + } + } + Err(s) => { + state.status = format!("Unable to parse address '{}', error: {}", buf_str, s); state.input_buf = Vec::with_capacity(0); state.state = Mode::Edit; } } - Err(s) => { - state.status = format!("Unable to parse address '{}', error: {}", buf_str, s); - state.input_buf = Vec::with_capacity(0); - state.state = Mode::Edit; - } } } Event::Key(Key::Esc) => { -- cgit v1.1