DEV Community

loading...

Discussion on: Error Handling in Rust programming language

Collapse
aminmansuri profile image
hidden_dude

You always care if its null. If something bad happens the calling function may need to abort. So the if statement is important to know if you have to abort or not.

Exceptions elegantly solve this problem. The Rust mechanism, since it doesn't interrupt execution, actually seems to make things more complex.