rust-lang / rustlings

:crab: Small exercises to get you used to reading and writing Rust code!
https://rustlings.cool
MIT License
54.15k stars 10.16k forks source link

Change hints of exercises traits4 and traits5 for a better learning experience #1978

Closed jkauerl closed 5 months ago

jkauerl commented 5 months ago

This pull request consist of one commit which changes the format of the hints in the exercises 4 and 5 of traits.

In short, it changes the "<" to "[" like this:

hint = """
"Instead of using concrete types as parameters you can use traits. Try replacing 
the '??' with 'impl [what goes here?]

See the documentation at: https://doc.rust-lang.org/book/ch10-02-traits.html#traits-as-parameters
"""

The reasoning for changing "<" is that right before you learn about using generics. So one could think that the solution to the exercises is by using generics.