mirror of
https://git.aramjonghu.dev/AramJonghu/rustlings.git
synced 2026-09-05 01:33:30 +02:00
primitive_types4 solution
This commit is contained in:
@@ -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 {
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user