Pretty cool. Didn't even know there was a crate for doing fancy curses-like GUI.
There's a more ergonomic way to wrangle error handling:
match result{ Ok(file) => ..., Err(error) =>
It pulls the value out so you don't have to do so much if result.is_ok() { result.ok().unwrap().... code.
if result.is_ok() { result.ok().unwrap()....
See RPL.
Thanks for the tip! Usingmatch looks a lot cleaner, I'll make sure to use that :)
match
Are you sure you want to hide this comment? It will become hidden in your post, but will still be visible via the comment's permalink.
Hide child comments as well
Confirm
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
Pretty cool. Didn't even know there was a crate for doing fancy curses-like GUI.
There's a more ergonomic way to wrangle error handling:
It pulls the value out so you don't have to do so much
if result.is_ok() { result.ok().unwrap()....
code.See RPL.
Thanks for the tip! Using
match
looks a lot cleaner, I'll make sure to use that :)