Things I Enjoy in Rust: Error Handling

Things I Enjoy in Rust: Error Handling

A lot of popular programming languages don’t have a good way to distinguish between these two kinds of errors, but in Rust this is done quite nicely. A function that returns , forces you to write some kind of code to handle the possibility of an error. Let’s compare two examples:

Even if you compacted the formatting of the C# snippet, or made some helper function to clean up the code, the fact that the idiomatic Rust code is so succinct is something that really appeals to me.

Source: blog.jonstodle.com