Moves in Function Calls

    • With the first call to , main gives up ownership of name. Afterwards, name cannot be used anymore within .
    • main can retain ownership if it passes as a reference (&name) and if say_hello accepts a reference as a parameter.
    • Rust makes it harder than C++ to inadvertently create copies by making move semantics the default, and by forcing programmers to make clones explicit.