Merge pull request #7497 from smores56/new-interpolation-syntax

Move to new interpolation syntax
This commit is contained in:
Sam Mohr 2025-01-10 15:25:12 -08:00 committed by GitHub
commit 528d1d2b69
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
66 changed files with 630 additions and 596 deletions

View file

@ -911,8 +911,8 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf) {
buf.push(escaped.to_parsed_char());
}
Interpolated(loc_expr) => {
buf.push_str("$(");
// e.g. (name) in "Hi, $(name)!"
buf.push_str("${");
// e.g. {name} in "Hi, ${name}!"
let min_indent = buf.cur_line_indent() + INDENT;
loc_expr.value.format_with_options(
buf,
@ -921,7 +921,7 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf) {
min_indent,
);
buf.indent(min_indent);
buf.push(')');
buf.push('}');
}
}
}