Hello All:

I am working on rust problems here. In the second question I solved it by simply adding the return statement for the function to modify. I am not sure what the lesson in ownership to walk away with in this problem. Any guidance?

  • @[email protected]
    link
    fedilink
    79 months ago

    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