pub fn intersect<T: PartialEq + Clone>(vec: &mut Vec<T>, vec2: &Vec<T>) -> bool {
    let mut indices_to_delete = vec![];

    for i in 0..vec.len() {
        if find_value(vec2, vec[0].clone()).is_none() {
            indices_to_delete.push(i);
        }
    }

    for i in indices_to_delete.iter() {
        vec.remove(*i);
    }

    indices_to_delete.len() != 0
}
/// intersects 1st vector with the 2nd one
/// (retains elements that also appear in the 2nd vector, and deletes elements that do not)
intersects 1st vector with the 2nd one
(retains elements that also appear in the 2nd vector, and deletes elements that do not)
intersects 1st vector with the 2nd one ( retains elements that also appear in the 2nd vector and deletes elements that do not )
pub fn intersect<T: PartialEq + Clone>(vec: &mut Vec<T>, vec2: &Vec<T>) -> bool {
    let mut indices_to_delete = vec![];
    for i in 0..vec.len() {
        if find_value(vec2, vec[0].clone()).is_none() {
            indices_to_delete.push(i);
        }
    }
    for i in indices_to_delete.iter() {
        vec.remove(*i);
    }
    indices_to_delete.len() != 0
}
pub fn intersect < T : PartialEq + Clone > ( vec : & mut Vec < T > , vec2 : & Vec < T > ) -> bool { let mut indices_to_delete = vec ! [ ] ; for i in 0 .. vec . len ( ) { if find_value ( vec2 , vec [ 0 ] . clone ( ) ) . is_none ( ) { indices_to_delete . push ( i ) ; } } for i in indices_to_delete . iter ( ) { vec . remove ( * i ) ; } indices_to_delete . len ( ) != 0 }
intersects 1st vector with the 2nd one
(retains elements that also appear in the 2nd vector, and deletes elements that do not)
intersects 1st vector with the 2nd one ( retains elements that also appear in the 2nd vector and deletes elements that do not )
vec
&mut Vec<T>
vec2
&Vec<T>
vec
&mut Vec<T>
vec2
&Vec<T>