summaryrefslogtreecommitdiff
path: root/exercises
diff options
context:
space:
mode:
authorAbdou Seck <djily02016@gmail.com>2021-04-13 10:39:18 -0400
committerGitHub <noreply@github.com>2021-04-13 10:39:18 -0400
commitcaf921a01fafc6caf2a8874b9a0af3b9decd2416 (patch)
treec53fa7cc3c81ab90ad43f453310f8fd8d35784e2 /exercises
parentad3cd54ccee1f9f879babf4a06079ebef1f16aff (diff)
parentab9995e76e10fb1159f9ca1f378e3e11838dc5bc (diff)
Merge pull request #674 from Morsicus/fix/collections-exercises-naming
Update collections exercises naming
Diffstat (limited to 'exercises')
-rw-r--r--exercises/collections/hashmap1.rs6
-rw-r--r--exercises/collections/hashmap2.rs6
-rw-r--r--exercises/collections/vec1.rs2
-rw-r--r--exercises/collections/vec2.rs9
4 files changed, 7 insertions, 16 deletions
diff --git a/exercises/collections/hashmap1.rs b/exercises/collections/hashmap1.rs
index b1dc0bb..64b5a7f 100644
--- a/exercises/collections/hashmap1.rs
+++ b/exercises/collections/hashmap1.rs
@@ -8,7 +8,7 @@
//
// Make me compile and pass the tests!
//
-// Execute the command `rustlings hint collections3` if you need
+// Execute the command `rustlings hint hashmap1` if you need
// hints.
// I AM NOT DONE
@@ -39,8 +39,6 @@ mod tests {
#[test]
fn at_least_five_fruits() {
let basket = fruit_basket();
- assert!(basket
- .values()
- .sum::<u32>() >= 5);
+ assert!(basket.values().sum::<u32>() >= 5);
}
}
diff --git a/exercises/collections/hashmap2.rs b/exercises/collections/hashmap2.rs
index 7e25be7..f865fe1 100644
--- a/exercises/collections/hashmap2.rs
+++ b/exercises/collections/hashmap2.rs
@@ -9,7 +9,7 @@
//
// Make me pass the tests!
//
-// Execute the command `rustlings hint collections4` if you need
+// Execute the command `rustlings hint hashmap2` if you need
// hints.
// I AM NOT DONE
@@ -75,9 +75,7 @@ mod tests {
fn greater_than_eleven_fruits() {
let mut basket = get_fruit_basket();
fruit_basket(&mut basket);
- let count = basket
- .values()
- .sum::<u32>();
+ let count = basket.values().sum::<u32>();
assert!(count > 11);
}
}
diff --git a/exercises/collections/vec1.rs b/exercises/collections/vec1.rs
index f6bc837..b144fb9 100644
--- a/exercises/collections/vec1.rs
+++ b/exercises/collections/vec1.rs
@@ -2,7 +2,7 @@
// Your task is to create a `Vec` which holds the exact same elements
// as in the array `a`.
// Make me compile and pass the test!
-// Execute the command `rustlings hint collections1` if you need hints.
+// Execute the command `rustlings hint vec1` if you need hints.
// I AM NOT DONE
diff --git a/exercises/collections/vec2.rs b/exercises/collections/vec2.rs
index ec6cfc0..6595e40 100644
--- a/exercises/collections/vec2.rs
+++ b/exercises/collections/vec2.rs
@@ -4,7 +4,7 @@
//
// Make me pass the test!
//
-// Execute the command `rustlings hint collections2` if you need
+// Execute the command `rustlings hint vec2` if you need
// hints.
// I AM NOT DONE
@@ -28,11 +28,6 @@ mod tests {
let v: Vec<i32> = (1..).filter(|x| x % 2 == 0).take(5).collect();
let ans = vec_loop(v.clone());
- assert_eq!(
- ans,
- v.iter()
- .map(|x| x * 2)
- .collect::<Vec<i32>>()
- );
+ assert_eq!(ans, v.iter().map(|x| x * 2).collect::<Vec<i32>>());
}
}