pub fn string_to_string(
        &mut self,
        name: &str,
        map: &BTreeMap<String, String>,
    ) -> Result<()> {
        if self.opts.fst_dir.is_some() {
            return err!("cannot emit string->string map as an FST");
        }

        self.header()?;
        self.separator()?;

        let name = rust_const_name(name);
        writeln!(
            self.wtr,
            "pub const {}: &'static [(&'static str, &'static str)] = &[",
            name
        )?;
        for (k, v) in map {
            self.wtr.write_str(&format!("({:?}, {:?}), ", k, v))?;
        }
        writeln!(self.wtr, "];")?;

        self.wtr.flush()?;
        Ok(())
    }
/// Write a map that associates strings to strings.
///
/// The only supported output format is a sorted slice, which can be
/// binary searched.
Write a map that associates strings to strings.
The only supported output format is a sorted slice, which can be
binary searched.
Write a map that associates strings to strings . The only supported output format is a sorted slice which can be binary searched .
pub fn string_to_string(
        &mut self,
        name: &str,
        map: &BTreeMap<String, String>,
    ) -> Result<()> {
        if self.opts.fst_dir.is_some() {
            return err!("cannot emit string->string map as an FST");
        }
        self.header()?;
        self.separator()?;
        let name = rust_const_name(name);
        writeln!(
            self.wtr,
            "pub const {}: &'static [(&'static str, &'static str)] = &[",
            name
        )?;
        for (k, v) in map {
            self.wtr.write_str(&format!("({:?}, {:?}), ", k, v))?;
        }
        writeln!(self.wtr, "];")?;
        self.wtr.flush()?;
        Ok(())
    }
pub fn string_to_string ( & mut self , name : & str , map : & BTreeMap < String , String > , ) -> Result < ( ) > { if self . opts . fst_dir . is_some ( ) { return err ! ( " " ) ; } self . header ( ) ? ; self . separator ( ) ? ; let name = rust_const_name ( name ) ; writeln ! ( self wtr " " name ) ? ; for ( k , v ) in map { self . wtr . write_str ( & format ! ( " " k v ) ) ? ; } writeln ! ( self wtr " " ) ? ; self . wtr . flush ( ) ? ; Ok ( ( ) ) }
Write a map that associates strings to strings.
Write a map that associates strings to strings .
&mut self
name
&str
map
&BTreeMap<String, String>
&mut self
name
&str
map
&BTreeMap<String, String>