Optimize interpolated strings.

This commit is contained in:
Stephen Chung 2021-09-20 22:36:10 +08:00
parent adbe9a292e
commit 8f94a60020

View File

@ -831,6 +831,8 @@ fn optimize_expr(expr: &mut Expr, state: &mut OptimizerState, chaining: bool) {
}
// `... ${ ... } ...`
Expr::InterpolatedString(x, _) => {
x.iter_mut().for_each(|expr| optimize_expr(expr, state, false));
let mut n = 0;
// Merge consecutive strings