2 ms·
I was thinking just yesterday while casting an int32 to a uint64 that theres no guarantee the int32 wasn’t negative beyond my knowledge that the code was only e
by donatj 6y ago
I was thinking just yesterday while casting an int32 to a uint64 that theres no guarantee the int32 wasn’t negative beyond my knowledge that the code was only ever incrementing it, and how most languages (that I have worked with at least) allow dangerous casting without enforcing any sort of error handling on the given operations.
I think this would fall into this category.
- japanuspus 6y agoYou should definitely have a go at rust where this conversion would have to be done explicitly via `try_from` [0] which may fail. [0]: https://doc.rust-lang.org/beta/std/convert/trait.TryFrom.html https://doc.rust-lang.org/beta/std/convert/trait.TryFrom.htm...