Learning about vectors

This commit is contained in:
Nidhal Messaoudi
2023-02-27 21:16:40 +01:00
parent f7678b4a9e
commit e3a20b8bc8
5 changed files with 9 additions and 19 deletions

View File

@@ -4,11 +4,9 @@
// Make me compile and pass the test!
// Execute `rustlings hint vecs1` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
fn array_and_vec() -> ([i32; 4], Vec<i32>) {
let a = [10, 20, 30, 40]; // a plain array
let v = // TODO: declare your vector here with the macro for vectors
let v = vec![10, 20, 30, 40]; // TODO: declare your vector here with the macro for vectors
(a, v)
}