pub fn index_or_insert<T: Eq>(vec: &mut Vec<T>, e: T) -> usize {
    for (i, e0) in vec.iter().enumerate() {
        if *e0 == e {
            return i;
        }
    }
    vec.push(e);
    vec.len() - 1
}
// Gets the index of an element in a vector
// If not found, inserts at tail and returns that
Gets the index of an element in a vector
If not found, inserts at tail and returns that
Gets the index of an element in a vector If not found inserts at tail and returns that
pub fn index_or_insert<T: Eq>(vec: &mut Vec<T>, e: T) -> usize {
    for (i, e0) in vec.iter().enumerate() {
        if *e0 == e {
            return i;
        }
    }
    vec.push(e);
    vec.len() - 1
}
pub fn index_or_insert < T : Eq > ( vec : & mut Vec < T > , e : T ) -> usize { for ( i , e0 ) in vec . iter ( ) . enumerate ( ) { if * e0 == e { return i ; } } vec . push ( e ) ; vec . len ( ) - 1 }
Gets the index of an element in a vector
If not found, inserts at tail and returns that
Gets the index of an element in a vector If not found inserts at tail and returns that
vec
&mut Vec<T>
e
T