How to do error handling in Rust and what are the common pitfalls?
Rust generally solves errors in two ways: Unrecoverable errors. Once you panic!, that’s it. Your program or thread aborts because it encounters something it can’t solve and its invariants have been violated. E.g. if you find invalid sequences in what should be a UTF-8 string. Recoverable errors. Also called failures in some documentation. Instead of … Read more