Why this fires¶
A numeric cast policy only applies to the conversion family it names.
For example, .wrap is defined only for integer-to-integer conversion, while
.trunc, .floor, .ceil, and .nearest_even convert floating-point values.
let value = 3.5.cast::<i32>(.wrap) // error[TE841]Fix it¶
Choose a compatible policy, or use as? when only exact values are accepted:
let truncated = 3.5.cast::<i32>(.trunc)?
let exact = 3.5 as? i32