pub fn insert_string(&self, string: String) -> usize {
        let mut inner = self.inner.borrow_mut();

        if let Some(id) = inner.strings_rev.get(&string).copied() {
            return id;
        }

        let id = inner.strings.len();
        inner.strings.push(string.clone());
        inner.strings_rev.insert(string, id);
        id
    }
/// Insert the given owned string into storage and return its id.
///
/// This will reuse old storage slots that already contains the given
/// string.
Insert the given owned string into storage and return its id.
This will reuse old storage slots that already contains the given
string.
Insert the given owned string into storage and return its id . This will reuse old storage slots that already contains the given string .
pub fn insert_string(&self, string: String) -> usize {
        let mut inner = self.inner.borrow_mut();
        if let Some(id) = inner.strings_rev.get(&string).copied() {
            return id;
        }
        let id = inner.strings.len();
        inner.strings.push(string.clone());
        inner.strings_rev.insert(string, id);
        id
    }
pub fn insert_string ( & self , string : String ) -> usize { let mut inner = self . inner . borrow_mut ( ) ; if let Some ( id ) = inner . strings_rev . get ( & string ) . copied ( ) { return id ; } let id = inner . strings . len ( ) ; inner . strings . push ( string . clone ( ) ) ; inner . strings_rev . insert ( string , id ) ; id }
Insert the given owned string into storage and return its id.
Insert the given owned string into storage and return its id .
&self
string
String
&self
string
String