Improved iterators5.rs explanation.
This commit is contained in:
11
info.toml
11
info.toml
@@ -694,7 +694,7 @@ Step 2 & step 2.1:
|
||||
Very similar to the lines above and below. You've got this!
|
||||
Step 3:
|
||||
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
|
||||
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.
|
||||
"""
|
||||
|
||||
@@ -749,12 +749,13 @@ hint = """
|
||||
The documentation for the std::iter::Iterator trait contains numerous methods
|
||||
that would be helpful here.
|
||||
|
||||
Return 0 from count_stack to make the code compile in order to test count.
|
||||
Return 0 from count_collection_iterator to make the code compile in order to
|
||||
test count_iterator.
|
||||
|
||||
The stack variable in count_stack is a slice of HashMaps. It needs to be
|
||||
converted into an iterator in order to use the iterator methods.
|
||||
The collection variable in count_collection_iterator is a slice of HashMaps. It
|
||||
needs to be converted into an iterator in order to use the iterator methods.
|
||||
|
||||
The fold method can be useful in the count_stack function."""
|
||||
The fold method can be useful in the count_collection_iterator function."""
|
||||
|
||||
# THREADS
|
||||
|
||||
|
||||
Reference in New Issue
Block a user