Cast a smaller integer to a larger integer

Implementing From will result in the Into implementation but not vice-versa. See also this documentation.

From and Into are generally intended to be lossless, infalliable conversions. as on the other hand can discard data and lead to bugs in some situations, for example casting a u64 to a usize may truncate the value on a 32-bit host. For integer casts in specific, using into() signals that there's no possible loss of data (From<u64> is not implemented for u32 for example).

More on as can be found in the reference.