carols10cents / carols10cents/rust-conversion-reference
u32 -> i32 conversion without possible loss of data?
Open
- Dominant language
- HTML
- Stars
- 40
- Forks
- 7
- PR merge metrics
- No merged PRs in 30d
Description
This is an amazing resource, thanks!
The suggested conversion for `u32` -> `i32` is `val as i32`. AFAIK, this will be inexact at values greater than `i32::MAX`. Would it be possible to also suggest a conversion to `Option` that returns `None` if the value cannot be safely converted?
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.