4 ms·
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
by fnord77 9y ago
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
- Shoothe 9y ago> 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.
- deleted 9y ago[deleted]
- w4tson 9y agoYou 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)
- pimeys 9y agoThis 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.