4 ms·
I think Rust has another good alternative to this, although it might be cheating a little: you can just write (lo..hi).rev(). That way, the common case of going
by bad-apple 6y ago
I think Rust has another good alternative to this, although it might be cheating a little: you can just write (lo..hi).rev(). That way, the common case of going forwards is nice, and the case of going backward isn't much worse.