diff options
| author | bors <bors@rust-lang.org> | 2019-08-11 15:44:40 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2019-08-11 15:44:40 +0000 |
| commit | f83af3c25d5b824391d2fb79e0c278a5f77bea21 (patch) | |
| tree | 296c2c9d5f657d7d721a75142575f3148bb08699 /exercises | |
| parent | e696a0719087aef9754ded25e71aa8d912503036 (diff) | |
| parent | e3931718fb7a4355f6fb99a297157df9c03ba694 (diff) | |
Auto merge of #207 - nkanderson:fix_iterators2, r=komaeda
Fix iterators2
A couple of small changes to the `iterators2` exercise. @Jesse-Cameron, it looks like you contributed this exercise, so I wanted to check and see if these changes are in line with your intentions. Happy to adjust if they're not :)
Diffstat (limited to 'exercises')
| -rw-r--r-- | exercises/standard_library_types/iterators2.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/exercises/standard_library_types/iterators2.rs b/exercises/standard_library_types/iterators2.rs index d102dc9..168368f 100644 --- a/exercises/standard_library_types/iterators2.rs +++ b/exercises/standard_library_types/iterators2.rs @@ -1,7 +1,7 @@ // iterators2.rs // In this module, you'll learn some of unique advantages that iterators can offer // Step 1. Complete the `capitalize_first` function to pass the first two cases -// Step 2. Apply the `capitalize_first` function to a vector of strings, ensuring that it +// Step 2. Apply the `capitalize_first` function to a vector of strings, ensuring that it returns a vector of strings as well // Step 3. Apply the `capitalize_first` function again to a list, but try and ensure it returns a single string // As always, there are hints below! @@ -9,7 +9,7 @@ pub fn capitalize_first(input: &str) -> String { let mut c = input.chars(); match c.next() { None => String::new(), - Some(first) => first.collect()::<String>() + c.as_str(), + Some(first) => first.collect::<String>() + c.as_str(), } } |
