summaryrefslogtreecommitdiff
path: root/exercises
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-06-08 23:42:15 +0200
committermo8it <mo8it@proton.me>2024-06-08 23:42:15 +0200
commit98db5790144a0d32009718e54051b3f7d54ae494 (patch)
tree69983a40b9b68db7c0bab34b9234aba06b28de95 /exercises
parent0338b1cbdfa567d5f9580afef1d4483c7d275c32 (diff)
primitive_types4 solution
Diffstat (limited to 'exercises')
-rw-r--r--exercises/04_primitive_types/primitive_types3.rs2
-rw-r--r--exercises/04_primitive_types/primitive_types4.rs7
2 files changed, 3 insertions, 6 deletions
diff --git a/exercises/04_primitive_types/primitive_types3.rs b/exercises/04_primitive_types/primitive_types3.rs
index bef5579..9b79c0c 100644
--- a/exercises/04_primitive_types/primitive_types3.rs
+++ b/exercises/04_primitive_types/primitive_types3.rs
@@ -1,5 +1,5 @@
fn main() {
- // TODO: Create an array with at least 100 elements in it where the ??? is.
+ // TODO: Create an array called `a` with at least 100 elements in it.
// let a = ???
if a.len() >= 100 {
diff --git a/exercises/04_primitive_types/primitive_types4.rs b/exercises/04_primitive_types/primitive_types4.rs
index 661e051..16e4fd9 100644
--- a/exercises/04_primitive_types/primitive_types4.rs
+++ b/exercises/04_primitive_types/primitive_types4.rs
@@ -1,18 +1,15 @@
-// Get a slice out of Array a where the ??? is so that the test passes.
-
fn main() {
// You can optionally experiment here.
}
#[cfg(test)]
mod tests {
- use super::*;
-
#[test]
fn slice_out_of_array() {
let a = [1, 2, 3, 4, 5];
- let nice_slice = ???
+ // TODO: Get a slice called `nice_slice` out of the array `a` so that the test passes.
+ // let nice_slice = ???
assert_eq!([2, 3, 4], nice_slice);
}