On Wed, Nov 20, 2013 at 5:58 PM, Tommi <rusty.ga...@icloud.com> wrote:

> Here's why: if you make a call foo(arg) and never use arg after that,
> then you don't care if arg gets moved or borrowed. And if you try to use
> arg afterwards and foo did in fact move it previously, then your IDE is
> going to tell you about it by drawing a red squiggly line under that
> incorrect use of arg.
>
>
This is from the point of view of the person writing the code. What about
someone reading the code? He/she would either have to go through the
remainder of the function/scope to make sure that `arg` was not being used
(if it were, then it was a borrow, otherwise, it could have been either a
borrow or a move); or they would have to look at the signature of `foo()`;
as opposed to just being able to tell right there at the call site.

--
Ziad
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to