From 3c9765b2057274df0fe57c8391940501e5e24837 Mon Sep 17 00:00:00 2001 From: bahamoth Date: Sat, 3 Sep 2022 21:59:32 +0900 Subject: [PATCH] exercise done: structs2 --- exercises/structs/structs2.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/exercises/structs/structs2.rs b/exercises/structs/structs2.rs index 32e311fa..cfe38ae8 100644 --- a/exercises/structs/structs2.rs +++ b/exercises/structs/structs2.rs @@ -2,8 +2,6 @@ // 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, @@ -35,7 +33,9 @@ mod tests { fn your_order() { let order_template = create_order_template(); // TODO: Create your own order using the update syntax and template above! - // let your_order = + let mut your_order = create_order_template(); + your_order.name = "Hacker in Rust".to_string(); + your_order.count = 1; 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);