mirror of
https://github.com/rust-lang/rustlings.git
synced 2026-01-07 03:09:19 +00:00
Exercise 32
This commit is contained in:
parent
d726f2a3e7
commit
35a8581791
@ -5,7 +5,7 @@
|
||||
// Execute `rustlings hint structs2` or use the `hint` watch subcommand for a
|
||||
// hint.
|
||||
|
||||
// I AM NOT DONE
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
struct Order {
|
||||
@ -38,7 +38,11 @@ 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 your_order = Order {
|
||||
name: String::from("Hacker in Rust"),
|
||||
count: 1,
|
||||
..order_template
|
||||
};
|
||||
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);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user