mirror of
https://github.com/notohh/rustlings.git
synced 2024-11-25 14:57:32 -05:00
feat(structs1): convert structs to use i32 types
This commit is contained in:
parent
2e62505143
commit
19bec50399
2 changed files with 7 additions and 5 deletions
|
@ -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]
|
||||
|
|
|
@ -357,7 +357,6 @@ Can you figure out how?
|
|||
|
||||
Another hint: it has to do with the `&` character."""
|
||||
|
||||
|
||||
# STRUCTS
|
||||
|
||||
[[exercises]]
|
||||
|
|
Loading…
Reference in a new issue