intellij's rust plugin is pretty good at type interference.
Also sometimes I just let the compiler tell me by forcing the let variable to something that it is obviously not:
`let not_a_string: String = get_something_that_I_have_no_idea();`
error [4242]: expected type String, found type &*YouWouldNeverHaveGuessed
You can get feedback before the compiler kicks in by asking IntelliJ to explicitly define the type.
Itβs a trick I used quite a bit when playing about with rust, and Kotlin actually.
Alt + Enter should invoke intentions pop up, you can do it from there. (I think)
> Also sometimes I just let the compiler tell me by forcing the let variable to something that it is obviously not:
Ha! Very clever! Thanks.
This works quite well, until you're dealing with stuff such as `AndThen` with 10 different nested futures. Here, again, async/await will be a great help.
Re:Rust's 2018 roadmap
by tototomtoboro on Monday March 12, 2018 @03:19PM
(#16570611)
Have you tried https://marketplace.visualstudio.com/items?itemName=rust-lan... ?
You will need the rls from nightly but its working very nicely for me.
Nope, I'll try that out tomorrow, thanks for the advice!
VS Code's handling of TypeScript really spoiled me but on the other hand it seems like tooling becomes more and more important in programming languages (e.g. Roslyn).
For me that's the biggest issue currently with Rust. Type inference via "let" only makes it harder as I can't really know what type a certain variable or expression is without carefully tracking docs. I've tried two Rust plug-ins for VS Code and even though they installed required dependencies I still couldn't have proper list of members when pressing "dot" and without that I feel like programming in the 90's.