4 ms·
One of the most use-full things of Rust is to have a clear "conversion" trait: https://doc.rust-lang.org/std/convert/trait.From.html https://doc.rust-lang.org/
by mamcx 7y ago
One of the most use-full things of Rust is to have a clear "conversion" trait:
https://doc.rust-lang.org/std/convert/trait.From.html https://doc.rust-lang.org/std/convert/trait.From.html
This is my #1 thing with rust.
Is a stroke of genius to have a clear API for make conversions.
- vmchale 7y agoIs there any writeup of the theory behind this? I'm particularly interested in type inference.
- killercup 7y agoThe RFC for adding `?` to the language might be a good start: https://rust-lang.github.io/rfcs/0243-trait-based-exception-handling.html https://rust-lang.github.io/rfcs/0243-trait-based-exception-...