3 ms·
I wish there would be a better syntax for the different overflow behaviors like n.checked_mul(m) and n.saturating_mul(m). Actually I'm not sure what should have
by Klasiaster 8y ago
I wish there would be a better syntax for the different overflow behaviors like n.checked_mul(m) and n.saturating_mul(m). Actually I'm not sure what should have been the default, but not only panicking for overflow in debug but not release mode is often hiding the problems.
- steveklabnik 8y agoWe left the rules such that we could enable panic in release if the performance is ever acceptable. Wrapping exists, but I don’t think anyone has bothered to make similar things for saturating...