diff --git a/TODO.md b/TODO.md index 2f18209..57f8b60 100644 --- a/TODO.md +++ b/TODO.md @@ -3,3 +3,4 @@ - Allow placing notes are locations in the bytes. - Use cross platform colors so when compiled with mingw, still get terminal colors - vihex may handle this +- Make l/L take filename as an argument diff --git a/src/lib.rs b/src/lib.rs index 781792b..46e75cd 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -625,12 +625,13 @@ pub fn load_state_from_file(state: &mut ec::State) { let filename = ec::read_string_from_user(Some( "Enter filename from which to load state: ")); if filename.is_ok() { - let new_state = State::read_from_filename(&filename.unwrap()); - if new_state.is_ok() { - *state = new_state.unwrap(); - } - else { - println!("? {:?}", new_state); + match State::read_from_filename(&filename.unwrap()) { + Ok(new_state) => { + *state = new_state; + }, + Err(err) => { + println!("? {}", err); + } } } else {