Skip to content

Commit 9590082

Browse files
committed
fix: update iterator and macro text for typos and clarity
- /macros/README.md: Typo "modules" => "macros" - iterators2.py: Reduce line length to <90-char width. - iterators4.py: Update 'fun' => 'challenge' as per PR#177 - rustlings hint iterators4: improve clarity
1 parent 32721bb commit 9590082

File tree

4 files changed

+14
-12
lines changed

4 files changed

+14
-12
lines changed

exercises/macros/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
Rust's macro system is very powerful, but also kind of difficult to wrap your
44
head around. We're not going to teach you how to write your own fully-featured
5-
modules, instead we'll show you how to use and create them.
5+
macros. Instead, we'll show you how to use and create them.
66

77
#### Book Sections
88

exercises/standard_library_types/iterators2.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
// iterators2.rs
2-
// In this module, you'll learn some of unique advantages that iterators can offer
3-
// Step 1. Complete the `capitalize_first` function to pass the first two cases
4-
// Step 2. Apply the `capitalize_first` function to a vector of strings, ensuring that it returns a vector of strings as well
5-
// Step 3. Apply the `capitalize_first` function again to a list, but try and ensure it returns a single string
2+
// In this module, you'll learn some of unique advantages that iterators can offer.
3+
// Step 1. Complete the `capitalize_first` function to pass the first two cases.
4+
// Step 2. Apply the `capitalize_first` function to a vector of strings.
5+
// Ensure that it returns a vector of strings as well.
6+
// Step 3. Apply the `capitalize_first` function again to a list.
7+
// Try to ensure it returns a single string.
68
// As always, there are hints if you execute `rustlings hint iterators2`!
79

810
// I AM NOT DONE

exercises/standard_library_types/iterators4.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,13 @@
33
// I AM NOT DONE
44

55
pub fn factorial(num: u64) -> u64 {
6-
// Complete this function to return factorial of num
6+
// Complete this function to return the factorial of num
77
// Do not use:
88
// - return
9-
// For extra fun don't use:
9+
// Try not to use:
1010
// - imperative style loops (for, while)
1111
// - additional variables
12-
// For the most fun don't use:
12+
// For an extra challenge, don't use:
1313
// - recursion
1414
// Execute `rustlings hint iterators4` for hints.
1515
}

info.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -640,10 +640,10 @@ name = "iterators4"
640640
path = "exercises/standard_library_types/iterators4.rs"
641641
mode = "test"
642642
hint = """
643-
In an imperative language you might write a for loop to iterate through
644-
multiply the values into a mutable variable. Or you might write code more
645-
functionally with recursion and a match clause. But you can also use ranges
646-
and iterators to solve this in rust."""
643+
In an imperative language, you might write a for loop that updates
644+
a mutable variable. Or, you might write code utilizing recursion
645+
and a match clause. In Rust you can take another functional
646+
approach, computing the factorial elegantly with ranges and iterators."""
647647

648648
# TRAITS
649649

0 commit comments

Comments
 (0)