Q. What is the result of the following code?
Code:
fn main() {
let s = String::from("hello");
let t = s;
println!("{}", s);
}
β
Correct Answer: (B)
Compilation error
Explanation: Ownership of 's' is moved to 't', so 's' is no longer valid.