pub(crate) fn scan_disjoint_segments<T: Ord + Copy>( events: impl IntoIterator<Item = Event<T, Cost>>, maker: impl FnMut(T, T, Cost), )