exercises 06 done, onto structs
This commit is contained in:
@@ -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)]
|
||||
|
||||
Reference in New Issue
Block a user