3 ms·
As a beginner, I think it's largely a matter of documentation. In Go, you can very easily see all the methods that a type implements. However, you don't see wh
by skybrian 7y ago
As a beginner, I think it's largely a matter of documentation.
In Go, you can very easily see all the methods that a type implements. However, you don't see which interfaces it implements because it's implicit.
In Rust, the methods are often hidden away in trait implementations, so it's harder to see what you can actually do.
It seems like this might be fixed if the doc tool generated an index to all the methods, as a reference? Or maybe there already is an easier way that I overlooked.
- staticassertion 7y agocargo doc does do that already, not sure what you mean. IDEs should also be autocompleting trait impls.
- skybrian 7y agoFor example, on std:String, the + operator is hidden away in the Add trait implementation. (In this case it's reasonably obvious anyway.)
- staticassertion 7y agoAh, interesting. I haven't really noticed that sort of thing myself.
- rhodysurf 7y agoMy experience is that it will only autocomplete traits that you have imported. Which sucks because what if I don’t know what traits my type uses? It’s crazy
- rakenodiax 7y agoIntelliJ will suggest unimported trait methods and will automatically import the required trait if it is selected.