Skip to content

Commit 20024d4

Browse files
committed
feat(iterators): update hint comments
1 parent 251d0dd commit 20024d4

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

exercises/standard_library_types/iterators1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// This module helps you get familiar with the structure of using an iterator and
77
// how to go through elements within an iterable collection.
88
//
9-
// Execute `rustlings hint iterators1` for hints :D
9+
// Execute `rustlings hint iterators1` or use the `hint` watch subcommand for a hint.
1010

1111
// I AM NOT DONE
1212

exercises/standard_library_types/iterators2.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// iterators2.rs
22
// In this exercise, you'll learn some of the unique advantages that iterators
33
// can offer. Follow the steps to complete the exercise.
4-
// As always, there are hints if you execute `rustlings hint iterators2`!
4+
// Execute `rustlings hint iterators2` or use the `hint` watch subcommand for a hint.
55

66
// I AM NOT DONE
77

exercises/standard_library_types/iterators3.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
// 1. Complete the divide function to get the first four tests to pass.
55
// 2. Get the remaining tests to pass by completing the result_with_list and
66
// list_of_results functions.
7-
// Execute `rustlings hint iterators3` to get some hints!
7+
// Execute `rustlings hint iterators3` or use the `hint` watch subcommand for a hint.
88

99
// I AM NOT DONE
1010

exercises/standard_library_types/iterators4.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
// iterators4.rs
2+
// Execute `rustlings hint iterators4` or use the `hint` watch subcommand for a hint.
23

34
// I AM NOT DONE
45

exercises/standard_library_types/iterators5.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
// imperative style for loops. Recreate this counting functionality using
77
// iterators. Only the two iterator methods (count_iterator and
88
// count_collection_iterator) need to be modified.
9-
// Execute `rustlings hint iterators5` for hints.
9+
// Execute `rustlings hint iterators5` or use the `hint` watch subcommand for a hint.
1010
//
1111
// Make the code compile and the tests pass.
1212

@@ -34,6 +34,7 @@ fn count_for(map: &HashMap<String, Progress>, value: Progress) -> usize {
3434
fn count_iterator(map: &HashMap<String, Progress>, value: Progress) -> usize {
3535
// map is a hashmap with String keys and Progress values.
3636
// map = { "variables1": Complete, "from_str": None, ... }
37+
todo!();
3738
}
3839

3940
fn count_collection_for(collection: &[HashMap<String, Progress>], value: Progress) -> usize {
@@ -52,6 +53,7 @@ fn count_collection_iterator(collection: &[HashMap<String, Progress>], value: Pr
5253
// collection is a slice of hashmaps.
5354
// collection = [{ "variables1": Complete, "from_str": None, ... },
5455
// { "variables2": Complete, ... }, ... ]
56+
todo!();
5557
}
5658

5759
#[cfg(test)]

info.toml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -802,7 +802,8 @@ case is a vector of integers and the failure case is a DivisionError.
802802
The list_of_results function needs to return a vector of results.
803803
804804
See https://doc.rust-lang.org/std/iter/trait.Iterator.html#method.collect for how
805-
the `FromIterator` trait is used in `collect()`."""
805+
the `FromIterator` trait is used in `collect()`. This trait is REALLY powerful! It
806+
can make the solution to this exercise infinitely easier."""
806807

807808
[[exercises]]
808809
name = "iterators4"
@@ -812,7 +813,9 @@ hint = """
812813
In an imperative language, you might write a for loop that updates
813814
a mutable variable. Or, you might write code utilizing recursion
814815
and a match clause. In Rust you can take another functional
815-
approach, computing the factorial elegantly with ranges and iterators."""
816+
approach, computing the factorial elegantly with ranges and iterators.
817+
818+
Hint 2: Check out the `fold` and `rfold` methods!"""
816819

817820
[[exercises]]
818821
name = "iterators5"

0 commit comments

Comments
 (0)