pub fn contiguous_ranges(
    values: impl Iterator<Item = u32>,
    max_len: usize
) -> impl Iterator<Item = Range<u32>>