File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -260,15 +260,14 @@ name = "vecs2"
260
260
path = " exercises/vecs/vecs2.rs"
261
261
mode = " test"
262
262
hint = """
263
- Hint 1: `i` is each element from the Vec as they are being iterated. Can you try
264
- multiplying this?
263
+ In the first function we are looping over the Vector and getting a reference to one `element` at a time.
264
+ To modify the value of that `element` we need to use the * dereference operator. You can learn more in this chapter of the Rust book:
265
+ https://doc.rust-lang.org/stable/book/ch08-01-vectors.html#iterating-over-the-values-in-a-vector
265
266
266
- Hint 2: For the first function, there's a way to directly access the numbers stored
267
- in the Vec, using the * dereference operator. You can both access and write to the
268
- number that way.
267
+ In the second function this dereferencing is not necessary, because the map function expects the new value to be returned.
269
268
270
- After you've completed both functions, decide for yourself which approach you like
271
- better. What do you think is the more commonly used pattern under Rust developers?
269
+ After you've completed both functions, decide for yourself which approach you like better.
270
+ What do you think is the more commonly used pattern under Rust developers?
272
271
"""
273
272
274
273
# MOVE SEMANTICS
You can’t perform that action at this time.
0 commit comments