News for hackers. Stuff that matters.
Re:100 Exercises to Learn Rust by simonask on Friday May 17, 2024 @03:11AM (#40387253)
`into()` just converts something from one type to another, like an integer to a floating point number. Would you have liked for such conversions to happen implicitly? Because let me tell you, that is one of the most painful features of C++, and modern well-written C++ typically disables implicit conversions in one way or another.

(Note: For the specific example of integer-to-float, Rust has an alternative built-in syntax, but `.into()` is the canonical way that also works in generic code.)

There are no comments on this comment yet.