diff options
Diffstat (limited to 'main.rs')
-rw-r--r-- | main.rs | 34 |
1 files changed, 17 insertions, 17 deletions
@@ -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) => { |