exercises 06 done, onto structs

This commit is contained in:
2026-06-17 16:13:28 +02:00
parent 6baf967df0
commit 8031b2858f
11 changed files with 112 additions and 27 deletions
+7 -2
View File
@@ -1,15 +1,20 @@
struct ColorRegularStruct {
// TODO: Add the fields that the test `regular_structs` expects.
// What types should the fields have? What are the minimum and maximum values for RGB colors?
green: i32,
red: i32,
blue: i32,
}
struct ColorTupleStruct(/* TODO: Add the fields that the test `tuple_structs` expects */);
#[derive(debug)]
struct ColorTupleStruct(i32, i32, i32);
#[derive(Debug)]
struct UnitStruct;
fn main() {
// You can optionally experiment here.
let color = ColorTupleStruct(12, 55, 200);
println!("{:?}", color)
}
#[cfg(test)]