9
By adding the return statement you pass the ownership of the string back to main. The unmodified function just took the ownership of the string and deallocated it after printing. Hope this helps
By adding the return statement you pass the ownership of the string back to main. The unmodified function just took the ownership of the string and deallocated it after printing. Hope this helps
Yeah thanks!
Welcome to the Rust community! This is a place to discuss about the Rust programming language.
Credits