pub fn show_escaped_idents(msg: &str) -> String {
    let mut replaced_msg = String::from(msg);

    let idents : HashMap<&str, Regex> = [
        ("å", Regex::new(r"__ao__").unwrap()),
        ("ä", Regex::new(r"__ae__").unwrap()),
        ("ö", Regex::new(r"__oe__").unwrap()),
        ("Å", Regex::new(r"__AO__").unwrap()),
        ("Ä", Regex::new(r"__AE__").unwrap()),
        ("Ö", Regex::new(r"__OE__").unwrap()),
        ("", Regex::new(r"__escaped_lua_keyword__").unwrap()),
    ].iter().cloned().collect();

    for (ident_sve, re) in idents {
        replaced_msg = re.replace_all(&replaced_msg, ident_sve).into()
    }

    replaced_msg
}
/// Convert from the escaped strings
/// back to what the user actually wrote.
Convert from the escaped strings
back to what the user actually wrote.
Convert from the escaped strings back to what the user actually wrote .
pub fn show_escaped_idents(msg: &str) -> String {
    let mut replaced_msg = String::from(msg);
    let idents : HashMap<&str, Regex> = [
        ("å", Regex::new(r"__ao__").unwrap()),
        ("ä", Regex::new(r"__ae__").unwrap()),
        ("ö", Regex::new(r"__oe__").unwrap()),
        ("Å", Regex::new(r"__AO__").unwrap()),
        ("Ä", Regex::new(r"__AE__").unwrap()),
        ("Ö", Regex::new(r"__OE__").unwrap()),
        ("", Regex::new(r"__escaped_lua_keyword__").unwrap()),
    ].iter().cloned().collect();
    for (ident_sve, re) in idents {
        replaced_msg = re.replace_all(&replaced_msg, ident_sve).into()
    }
    replaced_msg
}
pub fn show_escaped_idents ( msg : & str ) -> String { let mut replaced_msg = String :: from ( msg ) ; let idents : HashMap < & str , Regex > = [ ( " , egex: :n ew( r "__ao__") . u nwrap( ) ) , ( " , egex: :n ew( r "__ae__") . u nwrap( ) ) , ( " , egex: :n ew( r "__oe__") . u nwrap( ) ) , ( " , egex: :n ew( r "__AO__") . u nwrap( ) ) , ( " , egex: :n ew( r "__AE__") . u nwrap( ) ) , ( " , egex: :n ew( r "__OE__") . u nwrap( ) ) , ( " " , Regex :: new ( r"__escaped_lua_keyword__" ) . unwrap ( ) ) , ] . iter ( ) . cloned ( ) . collect ( ) ; for ( ident_sve , re ) in idents { replaced_msg = re . replace_all ( & replaced_msg , ident_sve ) . into ( ) } replaced_msg }
Convert from the escaped strings
back to what the user actually wrote.
Convert from the escaped strings back to what the user actually wrote .
msg
&str
msg
&str