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

@@ -3,8 +3,6 @@
// (no lines with multiple semicolons necessary!)
// Execute `rustlings hint move_semantics3` or use the `hint` watch subcommand for a hint.
// I AM NOT DONE
fn main() {
let vec0 = Vec::new();
@@ -17,7 +15,7 @@ fn main() {
println!("{} has length {} content `{:?}`", "vec1", vec1.len(), vec1);
}
fn fill_vec(vec: Vec<i32>) -> Vec<i32> {
fn fill_vec(mut vec: Vec<i32>) -> Vec<i32> {
vec.push(22);
vec.push(44);
vec.push(66);