feat(structs1): convert structs to use i32 types
This commit is contained in:
parent
2e62505143
commit
19bec50399
@ -1,5 +1,6 @@
|
||||
// structs1.rs
|
||||
// Address all the TODOs to make the tests pass!
|
||||
// Execute `rustlings hint structs1` or use the `hint` watch subcommand for a hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
@ -21,8 +22,9 @@ mod tests {
|
||||
// TODO: Instantiate a classic c struct!
|
||||
// let green =
|
||||
|
||||
assert_eq!(green.name, "green");
|
||||
assert_eq!(green.hex, "#00FF00");
|
||||
assert_eq!(green.red, 0);
|
||||
assert_eq!(green.green, 255);
|
||||
assert_eq!(green.blue, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
@ -30,8 +32,9 @@ mod tests {
|
||||
// TODO: Instantiate a tuple struct!
|
||||
// let green =
|
||||
|
||||
assert_eq!(green.0, "green");
|
||||
assert_eq!(green.1, "#00FF00");
|
||||
assert_eq!(green.0, 0);
|
||||
assert_eq!(green.1, 255);
|
||||
assert_eq!(green.2, 0);
|
||||
}
|
||||
|
||||
#[test]
|
||||
|
Loading…
Reference in New Issue
Block a user