|
|
@ -38,9 +38,12 @@ pub struct Film { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
fn main() { |
|
|
|
fn main() { |
|
|
|
let my_film = Film { name: "Terminator" }; |
|
|
|
let my_film = Film { name: "Terminator".toString() }; |
|
|
|
println!("{}", take_film_name(/* to be implemented */); |
|
|
|
println!("{}", take_film_name(/* to be implemented */)); |
|
|
|
println!("{}", read_film_name(/* to be implemented */); |
|
|
|
// the order of the print statements is intentional, if your implementation is correct, you should have a compile error because my_film was consumed |
|
|
|
|
|
|
|
println!("{}", read_film_name(/* to be implemented */)); |
|
|
|
|
|
|
|
println!("{}", take_film_name(/*to be implemented*/)) |
|
|
|
|
|
|
|
// you can test this function by commenting out the first print statement, you should see the expected output without errors in this case |
|
|
|
} |
|
|
|
} |
|
|
|
``` |
|
|
|
``` |
|
|
|
|
|
|
|
|
|
|
@ -50,6 +53,5 @@ And its output: |
|
|
|
$ cargo run |
|
|
|
$ cargo run |
|
|
|
Terminator |
|
|
|
Terminator |
|
|
|
Terminator |
|
|
|
Terminator |
|
|
|
Terminator |
|
|
|
|
|
|
|
$ |
|
|
|
$ |
|
|
|
``` |
|
|
|
``` |
|
|
|