11 ms·
Thats actually a lot less than i'd expect. Kinda curious on the do N.times -> for foo in range(0, N) changes. I thought I remember a recent post from you about
by mitchty 13y ago
Thats actually a lot less than i'd expect.
Kinda curious on the do N.times -> for foo in range(0, N) changes. I thought I remember a recent post from you about that. Any reason for the switch? (I ask as someone thats used ruby too much myself and is currently switching cold turkey to plain old C while rust gets a bit more mature)
- lifthrasiir 13y agoIt's since `do` now does not apply to stack closures [1]. `Do` still supports owned closures (that's what used to be called `~once fn()` in 0.8 and renamed to `proc()`) but they can be called only once which defeats the whole point of `times` (unless you are fine with `N.times(|| { ... })` syntax). [1] https://github.com/mozilla/rust/issues/10815 https://github.com/mozilla/rust/issues/10815
- mitchty 13y agoVery interesting thanks!