by conaclos · 1y ago · 0 comments
Regarding `as` casting, I completely agree. I am trying to use safe `From::from` instead. However, this is a bit noisy: `usize::from(n)` vs `n as usize`.
[0] https://doc.rust-lang.org/std/num/struct.Wrapping.html [1] https://doc.rust-lang.org/std/num/struct.Saturating.html
If there's enough information in the surrounding code for type inference to do its thing, you can shorten it to `n.into()`.