5 ms·
When you pass &variable, I don't think it affects the syntax inside the called function, does it?
by pepa65 1y ago
When you pass &variable, I don't think it affects the syntax inside the called function, does it?
- asa400 1y agoCorrect. If you then want to subsequently re-reference or dereference that reference (this happens sometimes), you'll need to accordingly `&` or `*` it, but if you're just using it as is, the bare syntactical `name` (whatever it happens to be) already refers to a reference.
- gf000 1y agoAlso, Rust does implicit dereferencing, so it's not that much of an issue in practice.