Progress: finished primitive types, vecs, movesematics. progress structs

This commit is contained in:
2026-07-10 23:35:48 +02:00
parent 1c85acbd7e
commit ab5b9bff14
15 changed files with 92 additions and 12 deletions
+2
View File
@@ -1,6 +1,8 @@
fn elems_to_vec(a: i32, b: i32, c: i32) -> Vec<i32> {
// TODO: Return a vector containing the elements a, b and c (in this order).
// Use the "vec!" macro.
let vector: Vec<i32> = vec![a, b, c];
vector
}
fn main() {
+2
View File
@@ -4,6 +4,8 @@ fn vec_loop(input: &[i32]) -> Vec<i32> {
for element in input {
// TODO: Multiply each element in the `input` slice by 2 and push it to
// the `output` vector.
output.push(element * 2);
}
output