When I try to type:
let mut guess = String::new();
It changes to:
let mut guess: String = String::new();
I am using VScode, why is this happening?
When I try to type:
let mut guess = String::new();
It changes to:
let mut guess: String = String::new();
I am using VScode, why is this happening?
These are called inlay hints. rust-analyzer shows you the inferred type of the variable so you know it, for easier code reading. VSCode does not actually change the code, just how it displays it.
If you don't like it, you can turn it off by setting rust-analyzer.inlayHints.typeHints.enable to false. This disables only this kind of inlay hints; there are many others you can control via the settings from the group rust-analyzer.inlayHints.