mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-11 05:09:19 +00:00
feat: improved closure docs and exercises by using into_iter()
This commit is contained in:
parent
2fd0e53365
commit
b8a901a9ea
@ -183,9 +183,9 @@ of a value owned by a called function.
|
||||
You can replace 'reduce()' with a different function call. Update the closure
|
||||
so that it matches the signature of this new call, and change the code to return
|
||||
the correct type from the sum_letters function. (Using 'sum()' is cheating!)
|
||||
OR you can change the sort of iterator you get, so that you don't have to return a reference.
|
||||
OR you can change the way you get the iterator, so that you don't have to return a reference.
|
||||
Pay close attention to the documentation linked to in the exercise: which type
|
||||
parameters are the same in the function signatures, and which are different. And
|
||||
parameters are the same in the function signatures, and which are different? And
|
||||
how do the return types of the variations of getting an iterator differ from each other?"""
|
||||
|
||||
[[exercises]]
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user