summaryrefslogtreecommitdiff
path: root/exercises/structs/structs2.rs
diff options
context:
space:
mode:
authorAdam Brewer <adamhb321@gmail.com>2023-10-16 07:37:12 -0400
committerAdam Brewer <adamhb321@gmail.com>2023-10-16 07:37:12 -0400
commit64d95837e9813541cf5b357de13865ce687ae98d (patch)
treef022c5d5ba01128811c0b77618a7adb843ee876b /exercises/structs/structs2.rs
parentc3941323e2c0b9ee286494327de92e00f23b9e3a (diff)
Update Exercises Directory Names to Reflect Order
Diffstat (limited to 'exercises/structs/structs2.rs')
-rw-r--r--exercises/structs/structs2.rs50
1 files changed, 0 insertions, 50 deletions
diff --git a/exercises/structs/structs2.rs b/exercises/structs/structs2.rs
deleted file mode 100644
index 328567f..0000000
--- a/exercises/structs/structs2.rs
+++ /dev/null
@@ -1,50 +0,0 @@
-// structs2.rs
-//
-// Address all the TODOs to make the tests pass!
-//
-// Execute `rustlings hint structs2` or use the `hint` watch subcommand for a
-// hint.
-
-// I AM NOT DONE
-
-#[derive(Debug)]
-struct Order {
- name: String,
- year: u32,
- made_by_phone: bool,
- made_by_mobile: bool,
- made_by_email: bool,
- item_number: u32,
- count: u32,
-}
-
-fn create_order_template() -> Order {
- Order {
- name: String::from("Bob"),
- year: 2019,
- made_by_phone: false,
- made_by_mobile: false,
- made_by_email: true,
- item_number: 123,
- count: 0,
- }
-}
-
-#[cfg(test)]
-mod tests {
- use super::*;
-
- #[test]
- fn your_order() {
- let order_template = create_order_template();
- // TODO: Create your own order using the update syntax and template above!
- // let your_order =
- assert_eq!(your_order.name, "Hacker in Rust");
- assert_eq!(your_order.year, order_template.year);
- assert_eq!(your_order.made_by_phone, order_template.made_by_phone);
- assert_eq!(your_order.made_by_mobile, order_template.made_by_mobile);
- assert_eq!(your_order.made_by_email, order_template.made_by_email);
- assert_eq!(your_order.item_number, order_template.item_number);
- assert_eq!(your_order.count, 1);
- }
-}