2 ms·
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(unvalid
by Sharlin 2mo ago
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.