We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2089901 commit cc6a141Copy full SHA for cc6a141
exercises/structs/structs1.rs
@@ -7,7 +7,8 @@ struct ColorClassicStruct {
7
8
struct ColorTupleStruct(/* TODO: Something goes here */);
9
10
-struct ColorUnitStruct;
+#[derive(Debug)]
11
+struct UnitStruct;
12
13
#[cfg(test)]
14
mod tests {
@@ -35,12 +36,9 @@ mod tests {
35
36
#[test]
37
fn unit_structs() {
38
// TODO: Instantiate a unit struct!
- // let green =
39
+ // let unit_struct =
40
+ let message = format!("{:?}s are fun!", unit_struct);
41
- if let ColorUnitStruct = green {
- assert!(true);
42
- } else {
43
- assert!(false);
44
- }
+ assert_eq!(message, "UnitStructs are fun!");
45
}
46
0 commit comments