diff options
author | Matt Brubeck <mbrubeck@limpet.net> | 2015-08-05 18:16:08 -0700 |
---|---|---|
committer | Matt Brubeck <mbrubeck@limpet.net> | 2015-08-05 18:28:20 -0700 |
commit | 8a09f738d417e92d22643244d6685bec195e0956 (patch) | |
tree | 6f0efe6fde0853c1a67e70777ceddb19b91f0483 /components | |
parent | afe3d7e747ca75afd8b641e2e4ab99f280a32e26 (diff) | |
download | servo-8a09f738d417e92d22643244d6685bec195e0956.tar.gz servo-8a09f738d417e92d22643244d6685bec195e0956.zip |
Replace Arc<Box<TextRun>> with Arc<TextRun>
Diffstat (limited to 'components')
-rw-r--r-- | components/gfx/display_list/mod.rs | 2 | ||||
-rw-r--r-- | components/gfx/paint_context.rs | 4 | ||||
-rw-r--r-- | components/layout/fragment.rs | 10 | ||||
-rw-r--r-- | components/layout/inline.rs | 2 | ||||
-rw-r--r-- | components/layout/text.rs | 2 |
5 files changed, 10 insertions, 10 deletions
diff --git a/components/gfx/display_list/mod.rs b/components/gfx/display_list/mod.rs index 5865b36a20a..49e4a796311 100644 --- a/components/gfx/display_list/mod.rs +++ b/components/gfx/display_list/mod.rs @@ -824,7 +824,7 @@ pub struct TextDisplayItem { /// The text run. #[ignore_heap_size_of = "Because it is non-owning"] - pub text_run: Arc<Box<TextRun>>, + pub text_run: Arc<TextRun>, /// The range of text within the text run. pub range: Range<CharIndex>, diff --git a/components/gfx/paint_context.rs b/components/gfx/paint_context.rs index a6875dc7bec..6fbdece15ec 100644 --- a/components/gfx/paint_context.rs +++ b/components/gfx/paint_context.rs @@ -1264,7 +1264,7 @@ impl ToRadiiPx for BorderRadii<Au> { trait ScaledFontExtensionMethods { fn draw_text(&self, draw_target: &DrawTarget, - run: &Box<TextRun>, + run: &TextRun, range: &Range<CharIndex>, baseline_origin: Point2D<Au>, color: Color, @@ -1274,7 +1274,7 @@ trait ScaledFontExtensionMethods { impl ScaledFontExtensionMethods for ScaledFont { fn draw_text(&self, draw_target: &DrawTarget, - run: &Box<TextRun>, + run: &TextRun, range: &Range<CharIndex>, baseline_origin: Point2D<Au>, color: Color, diff --git a/components/layout/fragment.rs b/components/layout/fragment.rs index c7b29d6212a..de6e29104c2 100644 --- a/components/layout/fragment.rs +++ b/components/layout/fragment.rs @@ -626,7 +626,7 @@ impl IframeFragmentInfo { #[derive(Clone)] pub struct ScannedTextFragmentInfo { /// The text run that this represents. - pub run: Arc<Box<TextRun>>, + pub run: Arc<TextRun>, /// The intrinsic size of the text fragment. pub content_size: LogicalSize<Au>, @@ -646,7 +646,7 @@ pub struct ScannedTextFragmentInfo { impl ScannedTextFragmentInfo { /// Creates the information specific to a scanned text fragment from a range and a text run. - pub fn new(run: Arc<Box<TextRun>>, + pub fn new(run: Arc<TextRun>, range: Range<CharIndex>, content_size: LogicalSize<Au>, requires_line_break_afterward_if_wrapping_on_newlines: bool) @@ -689,7 +689,7 @@ pub struct SplitResult { /// The part of the fragment that goes on the second line. pub inline_end: Option<SplitInfo>, /// The text run which is being split. - pub text_run: Arc<Box<TextRun>>, + pub text_run: Arc<TextRun>, } /// Describes how a fragment should be truncated. @@ -697,7 +697,7 @@ pub struct TruncationResult { /// The part of the fragment remaining after truncation. pub split: SplitInfo, /// The text run which is being truncated. - pub text_run: Arc<Box<TextRun>>, + pub text_run: Arc<TextRun>, } /// Data for an unscanned text fragment. Unscanned text fragments are the results of flow @@ -847,7 +847,7 @@ impl Fragment { } /// Transforms this fragment using the given `SplitInfo`, preserving all the other data. - pub fn transform_with_split_info(&self, split: &SplitInfo, text_run: Arc<Box<TextRun>>) + pub fn transform_with_split_info(&self, split: &SplitInfo, text_run: Arc<TextRun>) -> Fragment { let size = LogicalSize::new(self.style.writing_mode, split.inline_size, diff --git a/components/layout/inline.rs b/components/layout/inline.rs index 78363d0451c..52eb0879427 100644 --- a/components/layout/inline.rs +++ b/components/layout/inline.rs @@ -408,7 +408,7 @@ impl LineBreaker { fragment.specific { let scanned_text_fragment_info = &mut **scanned_text_fragment_info; let mut range = &mut scanned_text_fragment_info.range; - strip_trailing_whitespace_if_necessary(&**scanned_text_fragment_info.run, range); + strip_trailing_whitespace_if_necessary(&*scanned_text_fragment_info.run, range); let old_fragment_inline_size = fragment.border_box.size.inline + fragment.margin.inline_start_end(); diff --git a/components/layout/text.rs b/components/layout/text.rs index 88756a4f51d..7db4830fe9b 100644 --- a/components/layout/text.rs +++ b/components/layout/text.rs @@ -276,7 +276,7 @@ impl TextRunScanner { options.flags.insert(RTL_FLAG); } let mut font = fontgroup.fonts.get(run_info.font_index).unwrap().borrow_mut(); - Arc::new(box TextRun::new(&mut *font, run_info.text, &options, run_info.bidi_level)) + Arc::new(TextRun::new(&mut *font, run_info.text, &options, run_info.bidi_level)) }).collect::<Vec<_>>() }; |