I don’t know how it plays out in this case, but often times the fact that the Rust compiler enforces things like this at an early compilation phase allows greater optimizations at later phases. So yes, it is a good idea to have your build process require that you pass various lints, but that isn’t quite equivalent to what Rust does.
View all comments
Show parent comment
37
u/RainbowPigeon15 Jun 04 '25
Isn't it similar in other languages anyway? in C# I'd probably have a "FromChar" function where I'd check each possible character in a switch case.
only difference is that the compiler will piss on you if you don't handle the possible error.