pub(crate) fn normalize_collinear_segments<T: Ord + Copy>( segments: impl IntoIterator<Item = Segment<T>>, maker: impl FnMut(T, T, Cost), )