3 ms·
Agreed, but for that particular example, the compiler is smart enough to see that x is assigned exactly once, so you can have x be immutable in both examples.
by creata 5y ago
Agreed, but for that particular example, the compiler is smart enough to see that x is assigned exactly once, so you can have x be immutable in both examples.
https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=504978eb7a3de80c22d00fd402816660 https://play.rust-lang.org/?version=stable&mode=debug&editio...