pub fn add(&mut self, value: T) -> usize {
        match self.numbers.entry(value.clone()) {
            Entry::Occupied(e) => *e.get(),
            Entry::Vacant(e) => {
                let number = self.values.len() + self.start_at;
                self.values.push(value);
                e.insert(number);
                number
            }
        }
    }
/// Add an value. If the value has already been encountered before,
/// the corresponding number is returned.
Add an value. If the value has already been encountered before,
the corresponding number is returned.
Add an value . If the value has already been encountered before the corresponding number is returned .
pub fn add(&mut self, value: T) -> usize {
        match self.numbers.entry(value.clone()) {
            Entry::Occupied(e) => *e.get(),
            Entry::Vacant(e) => {
                let number = self.values.len() + self.start_at;
                self.values.push(value);
                e.insert(number);
                number
            }
        }
    }
pub fn add ( & mut self , value : T ) -> usize { match self . numbers . entry ( value . clone ( ) ) { Entry :: Occupied ( e ) => * e . get ( ) , Entry :: Vacant ( e ) => { let number = self . values . len ( ) + self . start_at ; self . values . push ( value ) ; e . insert ( number ) ; number } } }
Add an value.
Add an value .
&mut self
value
T