News for hackers. Stuff that matters.
Re:Using unwrap() in Rust is okay by spion on Monday August 08, 2022 @03:37PM (#32390025)
Rust does allow you to easily call functions or methods that may error by using the `?` operator (formerly `try!` macro)

https://doc.rust-lang.org/std/macro.try.html

You can also implement `From` (see `impl From` in the above doc) to define how you want external error types to be converted.

Its one of the rare languages where there isn't much boilerplate involved in using `Result`-style errors, even compared to exceptions (Swift is like this too)

There is even backtrace support for Result types: https://docs.rs/trace-error/latest/trace_error/

There are no comments on this comment yet.