fn retain_indexes<T>(items: &mut Vec<T>, indexes: &HashSet<usize>)
Keeps only the items at the provided indexes.