2 ms·
> Unless I'm mistaken, without narrow typing, this cast would be impossible same sized integer casts in Rusts are no-ops [0]; the conditional isn't type narrow
by dragonwriter 5y ago
> Unless I'm mistaken, without narrow typing, this cast would be impossible
same sized integer casts in Rusts are no-ops [0]; the conditional isn't type narrowing, it just avoids the cases where the cast would not preserve the same semantic value.
[0] https://doc.rust-lang.org/reference/expressions/operator-expr.html#type-cast-expressions https://doc.rust-lang.org/reference/expressions/operator-exp...
- alduin32 5y agoRight. Thank your for the correction.