mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 23:04:17 -05:00
Merge pull request #674 from Morsicus/fix/collections-exercises-naming
Update collections exercises naming
This commit is contained in:
commit
caf921a01f
5 changed files with 11 additions and 20 deletions
|
@ -8,7 +8,7 @@
|
||||||
//
|
//
|
||||||
// Make me compile and pass the tests!
|
// 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.
|
// hints.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
@ -39,8 +39,6 @@ mod tests {
|
||||||
#[test]
|
#[test]
|
||||||
fn at_least_five_fruits() {
|
fn at_least_five_fruits() {
|
||||||
let basket = fruit_basket();
|
let basket = fruit_basket();
|
||||||
assert!(basket
|
assert!(basket.values().sum::<u32>() >= 5);
|
||||||
.values()
|
|
||||||
.sum::<u32>() >= 5);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,7 +9,7 @@
|
||||||
//
|
//
|
||||||
// Make me pass the tests!
|
// Make me pass the tests!
|
||||||
//
|
//
|
||||||
// Execute the command `rustlings hint collections4` if you need
|
// Execute the command `rustlings hint hashmap2` if you need
|
||||||
// hints.
|
// hints.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
@ -75,9 +75,7 @@ mod tests {
|
||||||
fn greater_than_eleven_fruits() {
|
fn greater_than_eleven_fruits() {
|
||||||
let mut basket = get_fruit_basket();
|
let mut basket = get_fruit_basket();
|
||||||
fruit_basket(&mut basket);
|
fruit_basket(&mut basket);
|
||||||
let count = basket
|
let count = basket.values().sum::<u32>();
|
||||||
.values()
|
|
||||||
.sum::<u32>();
|
|
||||||
assert!(count > 11);
|
assert!(count > 11);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
// Your task is to create a `Vec` which holds the exact same elements
|
// Your task is to create a `Vec` which holds the exact same elements
|
||||||
// as in the array `a`.
|
// as in the array `a`.
|
||||||
// Make me compile and pass the test!
|
// 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
|
// I AM NOT DONE
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
//
|
//
|
||||||
// Make me pass the test!
|
// Make me pass the test!
|
||||||
//
|
//
|
||||||
// Execute the command `rustlings hint collections2` if you need
|
// Execute the command `rustlings hint vec2` if you need
|
||||||
// hints.
|
// hints.
|
||||||
|
|
||||||
// I AM NOT DONE
|
// I AM NOT DONE
|
||||||
|
@ -28,11 +28,6 @@ mod tests {
|
||||||
let v: Vec<i32> = (1..).filter(|x| x % 2 == 0).take(5).collect();
|
let v: Vec<i32> = (1..).filter(|x| x % 2 == 0).take(5).collect();
|
||||||
let ans = vec_loop(v.clone());
|
let ans = vec_loop(v.clone());
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(ans, v.iter().map(|x| x * 2).collect::<Vec<i32>>());
|
||||||
ans,
|
|
||||||
v.iter()
|
|
||||||
.map(|x| x * 2)
|
|
||||||
.collect::<Vec<i32>>()
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -359,7 +359,7 @@ each constant."""
|
||||||
# COLLECTIONS
|
# COLLECTIONS
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "collections1"
|
name = "vec1"
|
||||||
path = "exercises/collections/vec1.rs"
|
path = "exercises/collections/vec1.rs"
|
||||||
mode = "test"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
|
@ -373,7 +373,7 @@ of the Rust book to learn more.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "collections2"
|
name = "vec2"
|
||||||
path = "exercises/collections/vec2.rs"
|
path = "exercises/collections/vec2.rs"
|
||||||
mode = "test"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
|
@ -383,7 +383,7 @@ Hint 2: Check the suggestion from the compiler error ;)
|
||||||
"""
|
"""
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "collections3"
|
name = "hashmap1"
|
||||||
path = "exercises/collections/hashmap1.rs"
|
path = "exercises/collections/hashmap1.rs"
|
||||||
mode = "test"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
|
@ -394,7 +394,7 @@ Hint 2: Number of fruits should be at least 5. And you have to put
|
||||||
"""
|
"""
|
||||||
|
|
||||||
[[exercises]]
|
[[exercises]]
|
||||||
name = "collections4"
|
name = "hashmap2"
|
||||||
path = "exercises/collections/hashmap2.rs"
|
path = "exercises/collections/hashmap2.rs"
|
||||||
mode = "test"
|
mode = "test"
|
||||||
hint = """
|
hint = """
|
||||||
|
|
Loading…
Reference in a new issue