Hacker News new | ask | show | jobs
by l0b0 1215 days ago
> As a rule of thumb, if you don’t want the function to consume the data (to free it), don’t ask for ownership.

As a Rust beginner, that's a handy thing to remember! Thinking of variable passing in terms of least privilege seems much better than just trying to use the simplest syntax (changing ownership by passing the variable rather than a pointer to it) all the time.