mirror of
https://github.com/notohh/rustlings.git
synced 2025-07-02 23:19:16 -04:00
iterators1 solution
This commit is contained in:
parent
746cf6863d
commit
cf9041c0e4
3 changed files with 36 additions and 27 deletions
rustlings-macros
|
@ -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"
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue