pub(super) fn convert_tpl_to_str(&mut self, e: &mut Expr) {
        match e {
            Expr::Tpl(t) if t.quasis.len() == 1 && t.exprs.is_empty() => {
                let c = &t.quasis[0].raw;

                if c.value.chars().all(|c| match c {
                    '\u{0020}'..='\u{007e}' => true,
                    '\n' | '\r' => M::force_str_for_tpl(),
                    _ => false,
                }) && (M::force_str_for_tpl()
                    || (!c.value.contains("\\n") && !c.value.contains("\\r")))
                    && !c.value.contains("\\0")
                    && !c.value.contains("\\x")
                {
                    *e = Expr::Lit(Lit::Str(Str {
                        value: c
                            .value
                            .replace("\\`", "`")
                            .replace("\\$", "$")
                            .replace("\\n", "\n")
                            .replace("\\r", "\r")
                            .replace("\\\\", "\\")
                            .into(),
                        ..c.clone()
                    }));
                }
            }
            _ => {}
        }
    }
/// Converts template literals to string if `exprs` of [Tpl] is empty.
Converts template literals to string if `exprs` of [Tpl] is empty.
Converts template literals to string if ` exprs ` of [ Tpl ] is empty .
pub(super) fn convert_tpl_to_str(&mut self, e: &mut Expr) {
        match e {
            Expr::Tpl(t) if t.quasis.len() == 1 && t.exprs.is_empty() => {
                let c = &t.quasis[0].raw;
                if c.value.chars().all(|c| match c {
                    '\u{0020}'..='\u{007e}' => true,
                    '\n' | '\r' => M::force_str_for_tpl(),
                    _ => false,
                }) && (M::force_str_for_tpl()
                    || (!c.value.contains("\\n") && !c.value.contains("\\r")))
                    && !c.value.contains("\\0")
                    && !c.value.contains("\\x")
                {
                    *e = Expr::Lit(Lit::Str(Str {
                        value: c
                            .value
                            .replace("\\`", "`")
                            .replace("\\$", "$")
                            .replace("\\n", "\n")
                            .replace("\\r", "\r")
                            .replace("\\\\", "\\")
                            .into(),
                        ..c.clone()
                    }));
                }
            }
            _ => {}
        }
    }
pub ( super ) fn convert_tpl_to_str ( & mut self , e : & mut Expr ) { match e { Expr :: Tpl ( t ) if t . quasis . len ( ) == 1 && t . exprs . is_empty ( ) => { let c = & t . quasis [ 0 ] . raw ; if c . value . chars ( ) . all ( | c | match c { '\u{0020}' ..= '\u{007e}' => true , '\n' | '\r' => M :: force_str_for_tpl ( ) , _ => false , } ) && ( M :: force_str_for_tpl ( ) || ( ! c . value . contains ( " \\ " ) && ! c . value . contains ( " \\ " ) ) ) && ! c . value . contains ( " \\ " ) && ! c . value . contains ( " \\ " ) { * e = Expr :: Lit ( Lit :: Str ( Str { value : c . value . replace ( " \\ " , " " ) . replace ( " \\ " , " " ) . replace ( " \\ " , " \n " ) . replace ( " \\ " , " \r " ) . replace ( " \\ \\ " , " \\ " ) . into ( ) , .. c . clone ( ) } ) ) ; } } _ => { } } }
Converts template literals to string if `exprs` of [Tpl] is empty.
Converts template literals to string if ` exprs ` of [ Tpl ] is empty .
&mut self
e
&mut Expr