running 1 test
len: 15518
[[ 2 second delay ]]
test blahblah ... ok
This confuses me. When I first ran this w/o the thread::sleep, there was no output, so I thought perhaps the parent thread finished before anything run. Now, however, I have added a thread::sleep for 2 seconds. Yet, I still get no output. What am I doing wrong?
There should be a must_use warning in this case - did you not get that? That other thread would not have gotten the warning, because the iterator was in fact used, just lazily. But if you write a map that doesn't even get assigned to anything, this should get a warning.
You can use for_each instead of map if you just want to execute something without collect.