pub fn thread_chunks(n: usize) -> Vec<(usize, usize)>Expand description
Split 0..n into one contiguous range per rayon worker.
For fan-outs where each worker carries scratch proportional to the whole problem, one chunk per worker is what keeps the number of allocations and merges down to the thread count. Rayon’s own splitting is the better choice whenever the per-item work is self-contained.
§Params
n- Length of the range to split
§Returns
Half-open (start, end) ranges covering 0..n. Empty when n is zero.