But how? Let's see:
-
If
foo.into()converted usize to u64:- In 64-bit
usize— works correctly. - In 128-bit
usize— does not work correctly, but catches the invalid conversion at compile time.
- In 64-bit
-
If I have to use
foo as u64- In 64-bit
usize— works correctly. - In 128-bit
usize— does not work correctly, but the compiler does not catch the invalid conversion. Produces buggy code without warning.
- In 64-bit
So a 128-bit usize would break this code no matter what. The only difference is that .into() can catch the bug, and as can't.