simplify StrLiteral::Line to StrLiteral::PlainLine when possible

This commit is contained in:
Aidan 2024-08-17 00:03:05 -04:00
parent a14a110293
commit b0be698354
No known key found for this signature in database

View file

@ -624,6 +624,12 @@ impl<'a> Normalize<'a> for StrLiteral<'a> {
new_segments.push(StrSegment::Plaintext(last_text.into_bump_str()));
}
if new_segments.len() == 1 {
if let StrSegment::Plaintext(t) = new_segments[0] {
return StrLiteral::PlainLine(t);
}
}
StrLiteral::Line(new_segments.into_bump_slice())
}
StrLiteral::Block(t) => {