2 ms·
I believe what happens here is that the closure tries to capture it as a &&str. This is because it defaults to trying to take the environment by reference. The
by steveklabnik 6y ago
I believe what happens here is that the closure tries to capture it as a &&str. This is because it defaults to trying to take the environment by reference. The "move" in this case means that it will try to take it by value instead. This feels tricky semantically because references are types too, so "taking it by value" means taking a &T rather than a &&T, just like you may think about how taking a T is by value as opposed to &T.