Better HN
top
new
best
ask
show
jobs
Log in
Sign up
Better HN
Comment
by
95th
· 6y ago · 0 comments
Then what do you propose for replacement? C++ style casts `(int) x` ?
Comments
[–]
devit
6y ago
into()/try_into() and methods designed for each of the other cases (e.g. truncate(), saturating_to_int(), approx_to_float(), etc.)
[–]
erk__
6y ago
Using `x.into()` instead or `x.try_into()` if it can fail.