Home > Back-end >  Why is vscode inserting a `: String` in my for loop?
Why is vscode inserting a `: String` in my for loop?

Time:09-27

As you can see in the following picture, vscode is inserting that pink highlighted : String in the for loop. There is no actual text there, as if I move the cursor, it just skips over it, so it's just visual. What is vscode telling me to do with it? there's no suggestion when I hover over it.

enter image description here

CodePudding user response:

Disabling rust-analyzer.inlayHints.typeHints.enable removes type hints.

CodePudding user response:

VSCode is simply telling you the type of argument. The rust analyzer module puts these in places where the type is inferred to let you know what type the variable actually is.

  • Related