Skip to content

Commit caf921a

Browse files
authored
Merge pull request #674 from Morsicus/fix/collections-exercises-naming
Update collections exercises naming
2 parents ad3cd54 + ab9995e commit caf921a

File tree

5 files changed

+11
-20
lines changed

5 files changed

+11
-20
lines changed

exercises/collections/hashmap1.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
//
99
// Make me compile and pass the tests!
1010
//
11-
// Execute the command `rustlings hint collections3` if you need
11+
// Execute the command `rustlings hint hashmap1` if you need
1212
// hints.
1313

1414
// I AM NOT DONE
@@ -39,8 +39,6 @@ mod tests {
3939
#[test]
4040
fn at_least_five_fruits() {
4141
let basket = fruit_basket();
42-
assert!(basket
43-
.values()
44-
.sum::<u32>() >= 5);
42+
assert!(basket.values().sum::<u32>() >= 5);
4543
}
4644
}

exercises/collections/hashmap2.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
//
1010
// Make me pass the tests!
1111
//
12-
// Execute the command `rustlings hint collections4` if you need
12+
// Execute the command `rustlings hint hashmap2` if you need
1313
// hints.
1414

1515
// I AM NOT DONE
@@ -75,9 +75,7 @@ mod tests {
7575
fn greater_than_eleven_fruits() {
7676
let mut basket = get_fruit_basket();
7777
fruit_basket(&mut basket);
78-
let count = basket
79-
.values()
80-
.sum::<u32>();
78+
let count = basket.values().sum::<u32>();
8179
assert!(count > 11);
8280
}
8381
}

exercises/collections/vec1.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// Your task is to create a `Vec` which holds the exact same elements
33
// as in the array `a`.
44
// Make me compile and pass the test!
5-
// Execute the command `rustlings hint collections1` if you need hints.
5+
// Execute the command `rustlings hint vec1` if you need hints.
66

77
// I AM NOT DONE
88

exercises/collections/vec2.rs

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
//
55
// Make me pass the test!
66
//
7-
// Execute the command `rustlings hint collections2` if you need
7+
// Execute the command `rustlings hint vec2` if you need
88
// hints.
99

1010
// I AM NOT DONE
@@ -28,11 +28,6 @@ mod tests {
2828
let v: Vec<i32> = (1..).filter(|x| x % 2 == 0).take(5).collect();
2929
let ans = vec_loop(v.clone());
3030

31-
assert_eq!(
32-
ans,
33-
v.iter()
34-
.map(|x| x * 2)
35-
.collect::<Vec<i32>>()
36-
);
31+
assert_eq!(ans, v.iter().map(|x| x * 2).collect::<Vec<i32>>());
3732
}
3833
}

info.toml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ each constant."""
359359
# COLLECTIONS
360360

361361
[[exercises]]
362-
name = "collections1"
362+
name = "vec1"
363363
path = "exercises/collections/vec1.rs"
364364
mode = "test"
365365
hint = """
@@ -373,7 +373,7 @@ of the Rust book to learn more.
373373
"""
374374

375375
[[exercises]]
376-
name = "collections2"
376+
name = "vec2"
377377
path = "exercises/collections/vec2.rs"
378378
mode = "test"
379379
hint = """
@@ -383,7 +383,7 @@ Hint 2: Check the suggestion from the compiler error ;)
383383
"""
384384

385385
[[exercises]]
386-
name = "collections3"
386+
name = "hashmap1"
387387
path = "exercises/collections/hashmap1.rs"
388388
mode = "test"
389389
hint = """
@@ -394,7 +394,7 @@ Hint 2: Number of fruits should be at least 5. And you have to put
394394
"""
395395

396396
[[exercises]]
397-
name = "collections4"
397+
name = "hashmap2"
398398
path = "exercises/collections/hashmap2.rs"
399399
mode = "test"
400400
hint = """

0 commit comments

Comments
 (0)