Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
Dylan16807
· 9y ago · 0 comments
What does proper error handling look like when I want to use the same "invalid node" error for most of those unwrap calls?
Comments
[–]
staticassertion
9y ago
You 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.
[–]
EugeneOZ
9y ago
Use "try" or "?" if possible, pattern matching otherwise.