Use Box<str> instead of Box<String> for UnscannedTextFragmentInfo

This removes an extraneous layer of indirection, without increasing the size
of the `SpecificFragmentInfo` enum (because `Box<str>` is a fat pointer, which
is the same size as the `FlowRef` trait object that is already stored in
`InlineAbsoluteHypotheticalFragmentInfo`)
This commit is contained in:
Matt Brubeck 2015-08-05 18:00:31 -07:00
parent afe3d7e747
commit c4dde7297e
3 changed files with 5 additions and 7 deletions

View file

@ -398,9 +398,9 @@ fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList<Fragm
};
string_before =
box unscanned_text_fragment_info.text[..(position + 1)].to_owned();
unscanned_text_fragment_info.text[..(position + 1)].to_owned().into_boxed_slice();
unscanned_text_fragment_info.text =
box unscanned_text_fragment_info.text[(position + 1)..].to_owned();
unscanned_text_fragment_info.text[(position + 1)..].to_owned().into_boxed_slice();
}
first_fragment.transform(first_fragment.border_box.size,
SpecificFragmentInfo::UnscannedText(UnscannedTextFragmentInfo {