3 ms·
> To some extent it's nice that the callsite must document the behavior visually, but its more forcing a style guide rather than anything that's required to com
by deathanatos 9y ago
> To some extent it's nice that the callsite must document the behavior visually, but its more forcing a style guide rather than anything that's required to compile & work.
I've always figured that was the reason. It's immediately obvious at the call site that a borrow is happening, and that it is a mutable borrow. Otherwise, if you wanted to know, you'd need to inspect each of the function's signatures that the variable is passed to.
(Compare, perhaps, to C++ references, where it isn't apparent at the call site at all that your variable might change.)