2 ms·
I think Rust has no language construction for that, but the best implementation of "size as i32" should fail on overflow. In Haskell I would use an exception,
by marcosdumay 5y ago
I think Rust has no language construction for that, but the best implementation of "size as i32" should fail on overflow.
In Haskell I would use an exception, and mark the function as unsafe, but the stdlib seems to disagree with me here.