mirror of
https://github.com/roc-lang/roc.git
synced 2025-07-23 14:35:12 +00:00
simplify StrLiteral::Line
to StrLiteral::PlainLine
when possible
This commit is contained in:
parent
a14a110293
commit
b0be698354
1 changed files with 6 additions and 0 deletions
|
@ -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) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue