2 ms·
A flip side is that some safe conversions also produce compiler errors. On a 64-bit system, usize and u64 are the same width, but they are not convertible: neit
by ridiculous_fish 4y ago
A flip side is that some safe conversions also produce compiler errors. On a 64-bit system, usize and u64 are the same width, but they are not convertible: neither is Into the other, so you cannot lean on the compiler in the way you describe.
You might use try_into(), but then you risk panicking on a 32-bit system, instead of getting a compile-time error.