Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Linting is not good enough. The compiler should refuse to compile the code without it marked with an explicit annotation. Too much Rust code is panic happy since using casual use of `unwrap` is perma-etched into everyone's minds by the amount of demo code out there using unwrap.




I completely agree. But IMO Rust would have not gained traction if it was as strict. It would be branded as an academic toy language.

But now after we are past that and it has a lot of mind share, I'd say it's time to start tightening the bolts.


!#[deny(unwrap_used)] at the top of the file would take care of it.



Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: