summaryrefslogtreecommitdiff
path: root/exercises/07_structs/structs2.rs
diff options
context:
space:
mode:
authormo8it <mo8it@proton.me>2024-07-05 13:39:50 +0200
committermo8it <mo8it@proton.me>2024-07-05 13:39:50 +0200
commit7123c7ae3a9605fbe962e4ef0a0f1424cd16fef8 (patch)
treec67f7e62bb9a179ae4fdbab492501cb6847e64c7 /exercises/07_structs/structs2.rs
parent77b687d501771c24bd83294d97b8e6f9ffa92d6b (diff)
parent4d9c346a173bb722b929f3ea3c00f84954483e24 (diff)
Merge remote-tracking branch 'upstream/main' into fix-enum-variant-inconsistency
Diffstat (limited to 'exercises/07_structs/structs2.rs')
-rw-r--r--exercises/07_structs/structs2.rs15
1 files changed, 6 insertions, 9 deletions
diff --git a/exercises/07_structs/structs2.rs b/exercises/07_structs/structs2.rs
index 328567f..79141af 100644
--- a/exercises/07_structs/structs2.rs
+++ b/exercises/07_structs/structs2.rs
@@ -1,12 +1,3 @@
-// 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,
@@ -30,6 +21,10 @@ fn create_order_template() -> Order {
}
}
+fn main() {
+ // You can optionally experiment here.
+}
+
#[cfg(test)]
mod tests {
use super::*;
@@ -37,8 +32,10 @@ mod tests {
#[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);