pub fn lookup_maybe_insert(&mut self, s: &str) -> u32 {
        let h = calculate_hash(s);
        let next_index = self.idx_strs.len() as u32;
        let mut push_s = false;
        let index = self.strs_idx.entry(h)
            .or_insert_with(|| {
                push_s = true;
                next_index
            });
        if push_s {
            self.idx_strs.push(s);
        }
        *index
    }
/// Inserts a String into the index, if it doesn't exist, and looks up the index.
/// Takes ownership of the string.
Inserts a String into the index, if it doesn't exist, and looks up the index.
Takes ownership of the string.
Inserts a String into the index if it doesn ' t exist and looks up the index . Takes ownership of the string .
pub fn lookup_maybe_insert(&mut self, s: &str) -> u32 {
        let h = calculate_hash(s);
        let next_index = self.idx_strs.len() as u32;
        let mut push_s = false;
        let index = self.strs_idx.entry(h)
            .or_insert_with(|| {
                push_s = true;
                next_index
            });
        if push_s {
            self.idx_strs.push(s);
        }
        *index
    }
pub fn lookup_maybe_insert ( & mut self , s : & str ) -> u32 { let h = calculate_hash ( s ) ; let next_index = self . idx_strs . len ( ) as u32 ; let mut push_s = false ; let index = self . strs_idx . entry ( h ) . or_insert_with ( | | { push_s = true ; next_index } ) ; if push_s { self . idx_strs . push ( s ) ; } * index }
Inserts a String into the index, if it doesn't exist, and looks up the index.
Inserts a String into the index if it doesn ' t exist and looks up the index .
&mut self
s
&str