3 ms·
What does proper error handling look like when I want to use the same "invalid node" error for most of those unwrap calls?
by Dylan16807 10y ago
What does proper error handling look like when I want to use the same "invalid node" error for most of those unwrap calls?
- EugeneOZ 10y agoUse "try" or "?" if possible, pattern matching otherwise.
- staticassertion 10y agoYou can use map or and_then, you can write a macro, you can use try!, you can use if let, etc. There are lots of ways to handle errors in rust.