3 ms·
I think no-op is a bit misleading, and throwing away is more precise, since Rust has strict evaluation. let _ = timeConsumingFunction(); Still needs to sp
by Tehnix 7y ago
I think no-op is a bit misleading, and throwing away is more precise, since Rust has strict evaluation.
let _ = timeConsumingFunction();
Still needs to spend time performing timeConsumingFunction(). It might not move, but it still did the work and produced a result, you are just not using it (and hence not need to move it).
If you you had lazy evaluation I would agree with your argument for the no-op terminology.
- kzrdude 7y agoThat statement is different, the rhs is not a variable's name, so I agree with you, all of that is not a no-op.