pub fn lookup_value_or_insert(&mut self, value: &str) -> K {
        use hashbrown::hash_map::RawEntryMut;

        let hasher = &self.hash;
        let storage = &mut self.storage;
        let hash = hash_str(hasher, value);

        let entry = self
            .dedup
            .raw_entry_mut()
            .from_hash(hash, |key| value == storage.get(key.as_()).unwrap());

        match entry {
            RawEntryMut::Occupied(entry) => *entry.into_key(),
            RawEntryMut::Vacant(entry) => {
                let index = storage.append(value);
                let key =
                    K::from_usize(index).expect("failed to fit string index into dictionary key");
                *entry
                    .insert_with_hasher(hash, key, (), |key| {
                        let string = storage.get(key.as_()).unwrap();
                        hash_str(hasher, string)
                    })
                    .0
            }
        }
    }
/// Returns the id corresponding to value, adding an entry for the
/// id if it is not yet present in the dictionary.
Returns the id corresponding to value, adding an entry for the
id if it is not yet present in the dictionary.
Returns the id corresponding to value adding an entry for the id if it is not yet present in the dictionary .
pub fn lookup_value_or_insert(&mut self, value: &str) -> K {
        use hashbrown::hash_map::RawEntryMut;
        let hasher = &self.hash;
        let storage = &mut self.storage;
        let hash = hash_str(hasher, value);
        let entry = self
            .dedup
            .raw_entry_mut()
            .from_hash(hash, |key| value == storage.get(key.as_()).unwrap());
        match entry {
            RawEntryMut::Occupied(entry) => *entry.into_key(),
            RawEntryMut::Vacant(entry) => {
                let index = storage.append(value);
                let key =
                    K::from_usize(index).expect("failed to fit string index into dictionary key");
                *entry
                    .insert_with_hasher(hash, key, (), |key| {
                        let string = storage.get(key.as_()).unwrap();
                        hash_str(hasher, string)
                    })
                    .0
            }
        }
    }
pub fn lookup_value_or_insert ( & mut self , value : & str ) -> K { use hashbrown :: hash_map :: RawEntryMut ; let hasher = & self . hash ; let storage = & mut self . storage ; let hash = hash_str ( hasher , value ) ; let entry = self . dedup . raw_entry_mut ( ) . from_hash ( hash , | key | value == storage . get ( key . as_ ( ) ) . unwrap ( ) ) ; match entry { RawEntryMut :: Occupied ( entry ) => * entry . into_key ( ) , RawEntryMut :: Vacant ( entry ) => { let index = storage . append ( value ) ; let key = K :: from_usize ( index ) . expect ( " " ) ; * entry . insert_with_hasher ( hash , key , ( ) , | key | { let string = storage . get ( key . as_ ( ) ) . unwrap ( ) ; hash_str ( hasher , string ) } ) . 0 } } }
Returns the id corresponding to value, adding an entry for the
id if it is not yet present in the dictionary.
Returns the id corresponding to value adding an entry for the id if it is not yet present in the dictionary .
&mut self
value
&str
&mut self
value
&str