You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is problematic as the u8-to-u7 is range-checked, but the u32-to-u8 is not. This can be addressed by u7::new(x.try_into().unwrap()), but that's a) clunky and b) not const safe.
A good fix would be to provide new_from_u32 (or from_u32?) and try_new_from_u32/try_from_u32 (as well as other built-in types).
The text was updated successfully, but these errors were encountered:
In our codebase we see this pattern quite a lot:
This is problematic as the u8-to-u7 is range-checked, but the u32-to-u8 is not. This can be addressed by
u7::new(x.try_into().unwrap())
, but that's a) clunky and b) not const safe.A good fix would be to provide
new_from_u32
(orfrom_u32
?) andtry_new_from_u32
/try_from_u32
(as well as other built-in types).The text was updated successfully, but these errors were encountered: