Put UnscannedTextFragmentInfo in a Box

This reduces the size of the SpecificFragmentInfo enum from 48 to 24.
This commit is contained in:
Matt Brubeck 2016-03-28 22:03:25 -07:00
parent 14e945f09a
commit 31261f045e
5 changed files with 14 additions and 13 deletions

View file

@ -167,7 +167,7 @@ pub enum SpecificFragmentInfo {
TableWrapper,
Multicol,
MulticolColumn,
UnscannedText(UnscannedTextFragmentInfo),
UnscannedText(Box<UnscannedTextFragmentInfo>),
}
impl SpecificFragmentInfo {
@ -896,8 +896,8 @@ impl Fragment {
let mut unscanned_ellipsis_fragments = LinkedList::new();
unscanned_ellipsis_fragments.push_back(self.transform(
self.border_box.size,
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo::new("".to_owned(),
None))));
SpecificFragmentInfo::UnscannedText(
box UnscannedTextFragmentInfo::new("".to_owned(), None))));
let ellipsis_fragments = TextRunScanner::new().scan_for_runs(&mut layout_context.font_context(),
unscanned_ellipsis_fragments);
debug_assert!(ellipsis_fragments.len() == 1);