DEV Community

Discussion on: Rustifying Chat: Create a Terminal UI Chat App in Rust

Collapse
 
jeikabu profile image
jeikabu

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.

See RPL.

Collapse
 
sambajahlo profile image
Samba Diallo

Thanks for the tip! Usingmatch looks a lot cleaner, I'll make sure to use that :)