Ownership: Take and Return
Overview
Functions can take ownership of values and then return ownership back to the caller. This follows the same ownership transfer rules as assignment and returns.
While valid, this pattern is often verbose and motivates borrowing when you only need temporary access.
Official Rust Book: Ownership and Functions and Return Values and Scope