Borrowing a String
A better solution to the above problem is to modify greet
to take a reference.
Exercise Get rid of the .clone()
method call, and modify greet
to accept a &String
parameter. Then fix the calls to the greet
function in main
.