Skip to content

Commit 1dae782

Browse files
author
fmoko
authored
Merge pull request #598 from JuliaCao/update_exec_order
fix: added missing exercises to info.toml
2 parents 26110da + 90cfb6f commit 1dae782

File tree

2 files changed

+64
-0
lines changed

2 files changed

+64
-0
lines changed

exercises/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
| structs | §5.1 |
1111
| enums | §6 |
1212
| modules | §7.2 |
13+
| collections | §8.1 |
1314
| strings | §8.2 |
1415
| error_handling | §9 |
1516
| generics | §10 |

info.toml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,52 @@ its internal structure (the `fruits` and `veggies` modules and
356356
associated constants). It's almost there except for one keyword missing for
357357
each constant."""
358358

359+
# COLLECTIONS
360+
361+
[[exercises]]
362+
name = "collections1"
363+
path = "exercises/collections/vec1.rs"
364+
mode = "test"
365+
hint = """
366+
In Rust, there are two ways to define a Vector.
367+
1. One way is to use the `Vec::new()` function to create a new vector
368+
and fill it with the `push()` method.
369+
2. The second way, which is simpler is to use the `vec![]` macro and
370+
define your elements inside the square brackets.
371+
Check this chapter: https://doc.rust-lang.org/stable/book/ch08-01-vectors.html
372+
of the Rust book to learn more.
373+
"""
374+
375+
[[exercises]]
376+
name = "collections2"
377+
path = "exercises/collections/vec2.rs"
378+
mode = "test"
379+
hint = """
380+
Hint 1: `i` is each element from the Vec as they are being iterated.
381+
Can you try multiplying this?
382+
Hint 2: Check the suggestion from the compiler error ;)
383+
"""
384+
385+
[[exercises]]
386+
name = "collections3"
387+
path = "exercises/collections/hashmap1.rs"
388+
mode = "test"
389+
hint = """
390+
Hint 1: Take a look at the return type of the function to figure out
391+
the type for the `basket`.
392+
Hint 2: Number of fruits should be at least 5. And you have to put
393+
at least three different types of fruits.
394+
"""
395+
396+
[[exercises]]
397+
name = "collections4"
398+
path = "exercises/collections/hashmap2.rs"
399+
mode = "test"
400+
hint = """
401+
Use the `entry()` and `or_insert()` methods of `HashMap` to achieve this.
402+
Learn more at https://doc.rust-lang.org/stable/book/ch08-03-hash-maps.html#only-inserting-a-value-if-the-key-has-no-value
403+
"""
404+
359405
# STRINGS
360406

361407
[[exercises]]
@@ -636,6 +682,23 @@ inside the loop but still in the main thread.
636682
`child_numbers` should be a clone of the Arc of the numbers instead of a
637683
thread-local copy of the numbers."""
638684

685+
[[exercises]]
686+
name = "iterators1"
687+
path = "exercises/standard_library_types/iterators1.rs"
688+
mode = "compile"
689+
hint = """
690+
Step 1:
691+
We need to apply something to the collection `my_fav_fruits` before we start to go through
692+
it. What could that be? Take a look at the struct definition for a vector for inspiration:
693+
https://doc.rust-lang.org/std/vec/struct.Vec.html.
694+
Step 2 & step 2.1:
695+
Very similar to the lines above and below. You've got this!
696+
Step 3:
697+
An iterator goes through all elements in a collection, but what if we've run out of
698+
elements? What should we expect here? If you're stuck, take a look at
699+
https://doc.rust-lang.org/std/iter/trait.Iterator.html for some ideas.
700+
"""
701+
639702
[[exercises]]
640703
name = "iterators2"
641704
path = "exercises/standard_library_types/iterators2.rs"

0 commit comments

Comments
 (0)