This issue describes how to implement the turbofish concept exercise for the rust track.
Goal
Rust offers the ::<_> operator, popularly known as the turbofish. AFAIK no other language has this operator, which is used for offering hints to the type inferencer where it would otherwise fail.
In v2, we have shoehorned some instruction about this operator into the reverse-string exercise, but this comes with a drawback: it implies that people should use the manual operator even when the code is simpler and clearer without it.
Things to teach
existence of turbofish operator
when and how to use turbofish operator
Things not to teach
turbofish should be used unconditionally
partial type hints i.e. collect::<Result<Vec<_>, _>>()
This issue describes how to implement the
turbofish
concept exercise for the rust track.Goal
Rust offers the
::<_>
operator, popularly known as the turbofish. AFAIK no other language has this operator, which is used for offering hints to the type inferencer where it would otherwise fail.In v2, we have shoehorned some instruction about this operator into the
reverse-string
exercise, but this comes with a drawback: it implies that people should use the manual operator even when the code is simpler and clearer without it.Things to teach
Things not to teach
collect::<Result<Vec<_>, _>>()
Concepts
Prequisites
Implementing
A sketch of an exercise implementation exists on the playground
Help
If you have any questions while implementing the exercise, please post the questions as comments in this issue.