Skip to main content

remove_duplicates

Function remove_duplicates 

Source
pub fn remove_duplicates<T, F>(arr: &mut [T], equal: &F) -> usize
where T: Copy, F: Fn(&T, &T) -> bool,
Expand description

Remove duplicates from a sorted slice. Returns the number of remaining elements. The slice is modified in place (duplicates are overwritten, tail is unchanged).

Port of C++ remove_duplicates.