3 ms·
To expand on this, if you use CLion as your Rust IDE it will actually show you the types for all your variables automatically. For example, if you had a line li
by CDSlice 6y ago
To expand on this, if you use CLion as your Rust IDE it will actually show you the types for all your variables automatically. For example, if you had a line like this:
let foo = vec![1, 2, 3];
CLion would then show the type in a faded font where the type would go if you wrote it out manually like so:
let foo: Vec<i32> = vec![1, 2, 3];
This is extremely useful when working with more complicated types such as iterator chain because it lets you see exactly what type everything is without having to manually write it all out and have the compiler check it.
- riquito 6y agoThat's available with VSCode and rust-analyzer too (but I suspect others that piggyback on rust-analyzer got that ability). It can get noisy fast, but you can toggle hints for when you need them