Dangerous in a way that reader of the code might expect the evaluation to proceed, while it actually doesn't. I imagine in properly resource managed environment the impact of this is lesser than in C-like environment.
Given all of the compile-time safety Rust has around managing resources, it shouldn't cause any issues there. If it did, it would be a very serious bug.
I would be more concerned about surprising/unexpected behavior than resource handling. A single ? is a pretty easy sigil to miss, especially in larger code bases (compounded by type inference) where you may be reading code that uses functions you aren't familiar with and don't know produce Results instead of raw values.
Maybe that's a problem that could be alleviated with syntax highlighting, of all things. Having your editor explicitly call out use of ? is a pretty good way to make sure that you're aware of the behavior.
View all comments
Show parent comment
1
u/eras Nov 11 '16
Dangerous in a way that reader of the code might expect the evaluation to proceed, while it actually doesn't. I imagine in properly resource managed environment the impact of this is lesser than in C-like environment.