diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index c7b29d6212a..276f4e25a7f 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -705,10 +705,7 @@ pub struct TruncationResult { #[derive(Clone)] pub struct UnscannedTextFragmentInfo { /// The text inside the fragment. - /// - /// FIXME(pcwalton): Is there something more clever we can do here that avoids the double - /// indirection while not penalizing all fragments? - pub text: Box, + pub text: Box, } impl UnscannedTextFragmentInfo { @@ -716,7 +713,7 @@ impl UnscannedTextFragmentInfo { #[inline] pub fn from_text(text: String) -> UnscannedTextFragmentInfo { UnscannedTextFragmentInfo { - text: box text, + text: text.into_boxed_slice(), } } } diff --git a/components/layout/lib.rs b/components/layout/lib.rs index c68e5f300cd..4dfb35e77c2 100644 --- a/components/layout/lib.rs +++ b/components/layout/lib.rs @@ -4,6 +4,7 @@ #![feature(append)] #![feature(arc_unique)] +#![feature(box_str)] #![feature(box_syntax)] #![feature(cell_extras)] #![feature(custom_derive)] diff --git a/components/layout/text.rs b/components/layout/text.rs index 88756a4f51d..5a66199b981 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -398,9 +398,9 @@ fn split_first_fragment_at_newline_if_necessary(fragments: &mut LinkedList