roc format now auto-upgrades string interpolation

This commit is contained in:
Richard Feldman 2024-02-26 23:08:25 -05:00
parent 6f84e24fa5
commit 6978ca7bf3
No known key found for this signature in database
GPG key ID: F1F21AA5B1D9E43B

View file

@ -612,18 +612,7 @@ fn format_str_segment(seg: &StrSegment, buf: &mut Buf, indent: u16) {
buf.push('\\');
buf.push(escaped.to_parsed_char());
}
DeprecatedInterpolated(loc_expr) => {
buf.push_str("\\(");
// e.g. (name) in "Hi, $(name)!"
loc_expr.value.format_with_options(
buf,
Parens::NotNeeded, // We already printed parens!
Newlines::No, // Interpolations can never have newlines
indent,
);
buf.push(')');
}
Interpolated(loc_expr) => {
DeprecatedInterpolated(loc_expr) | Interpolated(loc_expr) => {
buf.push_str("$(");
// e.g. (name) in "Hi, $(name)!"
loc_expr.value.format_with_options(