simplify StrLiteral::Line to StrLiteral::PlainLine in block strings as well

This commit is contained in:
Aidan 2024-08-17 10:06:50 -04:00
parent 1551d8fb0d
commit aef9d81eaa
No known key found for this signature in database

View file

@ -642,6 +642,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())
}
}