mirror of
https://github.com/rust-lang/rustlings.git
synced 2025-06-15 00:04:58 +02:00
iterators1 solution
This commit is contained in:
@ -886,22 +886,9 @@ https://doc.rust-lang.org/stable/book/ch11-01-writing-tests.html#checking-for-pa
|
||||
name = "iterators1"
|
||||
dir = "18_iterators"
|
||||
hint = """
|
||||
Step 1:
|
||||
|
||||
We need to apply something to the collection `my_fav_fruits` before we start to
|
||||
go through it. What could that be? Take a look at the struct definition for a
|
||||
vector for inspiration:
|
||||
https://doc.rust-lang.org/std/vec/struct.Vec.html
|
||||
|
||||
Step 2 & step 3:
|
||||
|
||||
Very similar to the lines above and below. You've got this!
|
||||
|
||||
Step 4:
|
||||
|
||||
An iterator goes through all elements in a collection, but what if we've run
|
||||
out of elements? What should we expect here? If you're stuck, take a look at
|
||||
https://doc.rust-lang.org/std/iter/trait.Iterator.html for some ideas."""
|
||||
https://doc.rust-lang.org/std/iter/trait.Iterator.html"""
|
||||
|
||||
[[exercises]]
|
||||
name = "iterators2"
|
||||
|
Reference in New Issue
Block a user