from Hacker News

Rustlang Ownership: Visual Analogy

by giis on 6/14/21, 7:53 AM with 6 comments

  • by spoiler on 6/14/21, 10:05 AM

    I appreciate the sentiment for this, but I personally find the art and composition off-putting.

    The writing is a bit confusing. What's with the file transfer jargon?

    Was this part of a bigger presentation or blog post maybe?

  • by Deukhoofd on 6/14/21, 9:48 AM

    I like the pattern where it gives ownership, and the return value returns that ownership. I hadn't really considered that as a valid pattern yet, coming from other languages!
  • by x4e on 6/14/21, 8:21 PM

    To be slightly pedantic, the comment in the code example labels a clone as a "copy" which is not really correct.

    Strings can’t even be copied since they are heap allocated.