diff --git a/components/gfx/font.rs b/components/gfx/font.rs index 9c1afea6e57..2a1c9ee82e4 100644 --- a/components/gfx/font.rs +++ b/components/gfx/font.rs @@ -53,7 +53,7 @@ pub trait FontHandleMethods: Sized { fn glyph_h_advance(&self, GlyphId) -> Option; fn glyph_h_kerning(&self, GlyphId, GlyphId) -> FractionalPixel; fn metrics(&self) -> FontMetrics; - fn table_for_tag(&self, FontTableTag) -> Option>; + fn table_for_tag(&self, FontTableTag) -> Option; } // Used to abstract over the shaper's choice of fixed int representation. @@ -206,7 +206,7 @@ impl Font { self.shaper.as_ref().unwrap() } - pub fn table_for_tag(&self, tag: FontTableTag) -> Option> { + pub fn table_for_tag(&self, tag: FontTableTag) -> Option { let result = self.handle.table_for_tag(tag); let status = if result.is_some() { "Found" } else { "Didn't find" }; diff --git a/components/gfx/platform/freetype/font.rs b/components/gfx/platform/freetype/font.rs index 1ee14127f48..62982e92170 100644 --- a/components/gfx/platform/freetype/font.rs +++ b/components/gfx/platform/freetype/font.rs @@ -260,7 +260,7 @@ impl FontHandleMethods for FontHandle { metrics } - fn table_for_tag(&self, tag: FontTableTag) -> Option> { + fn table_for_tag(&self, tag: FontTableTag) -> Option { let tag = tag as FT_ULong; unsafe { @@ -274,7 +274,7 @@ impl FontHandleMethods for FontHandle { if !FT_Load_Sfnt_Table(self.face, tag, 0, buf.as_mut_ptr(), &mut len).succeeded() { return None } - Some(box FontTable { buffer: buf }) + Some(FontTable { buffer: buf }) } } } diff --git a/components/gfx/platform/macos/font.rs b/components/gfx/platform/macos/font.rs index f1d418350d4..7f642634495 100644 --- a/components/gfx/platform/macos/font.rs +++ b/components/gfx/platform/macos/font.rs @@ -209,10 +209,10 @@ impl FontHandleMethods for FontHandle { metrics } - fn table_for_tag(&self, tag: FontTableTag) -> Option> { + fn table_for_tag(&self, tag: FontTableTag) -> Option { let result: Option = self.ctfont.get_font_table(tag); result.and_then(|data| { - Some(box FontTable::wrap(data)) + Some(FontTable::wrap(data)) }) } } diff --git a/components/gfx/text/shaping/harfbuzz.rs b/components/gfx/text/shaping/harfbuzz.rs index 9f5615e491b..a1457e4ffd0 100644 --- a/components/gfx/text/shaping/harfbuzz.rs +++ b/components/gfx/text/shaping/harfbuzz.rs @@ -519,7 +519,7 @@ extern fn font_table_func(_: *mut hb_face_t, // `Box::into_raw` intentionally leaks the FontTable so we don't destroy the buffer // while HarfBuzz is using it. When HarfBuzz is done with the buffer, it will pass // this raw pointer back to `destroy_blob_func` which will deallocate the Box. - let font_table_ptr = Box::into_raw(font_table); + let font_table_ptr = Box::into_raw(box font_table); let buf = (*font_table_ptr).buffer(); // HarfBuzz calls `destroy_blob_func` when the buffer is no longer needed.