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

The Rust standard library has `NonZero<T>`, which, if used, at least forces you to consider what you initialize it with. Doing

  let foo = NonZero::new(unvalidated_input).unwrap();
is at the very least a big red sign that stands out in the code and should fail code review.


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

Search: