Fix the Move
Oh no! This code tries to use a String after it was moved. Fix it so the program compiles and prints:
text
Hello, Luna! Name is: Luna
Hint: Use borrowing (&) so the function doesn't take ownership!
rust
fn greet(name: String) {
println!("Hello, {}!", name);
}
fn main() {
let name = String::from("Luna");
greet(name);
println!("Name is: {}", name);
}