From d93d64e1f35ceae4a23d31b4e9177a2c5b0fd003 Mon Sep 17 00:00:00 2001 From: eri Date: Fri, 8 Mar 2024 00:16:18 +0100 Subject: [PATCH] fix: add font context default in other platforms --- components/gfx/platform/macos/font_context.rs | 9 +-------- components/gfx/platform/windows/font_context.rs | 9 +-------- 2 files changed, 2 insertions(+), 16 deletions(-) diff --git a/components/gfx/platform/macos/font_context.rs b/components/gfx/platform/macos/font_context.rs index 753cb97a572db..a93fa8efb4a72 100644 --- a/components/gfx/platform/macos/font_context.rs +++ b/components/gfx/platform/macos/font_context.rs @@ -4,18 +4,11 @@ use malloc_size_of::{MallocSizeOf, MallocSizeOfOps}; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct FontContextHandle { _ctx: (), } -impl FontContextHandle { - // this is a placeholder until NSFontManager or whatever is bound in here. - pub fn new() -> FontContextHandle { - FontContextHandle { _ctx: () } - } -} - impl MallocSizeOf for FontContextHandle { fn size_of(&self, _: &mut MallocSizeOfOps) -> usize { 0 diff --git a/components/gfx/platform/windows/font_context.rs b/components/gfx/platform/windows/font_context.rs index d5e0015dd5621..a67a366fc119e 100644 --- a/components/gfx/platform/windows/font_context.rs +++ b/components/gfx/platform/windows/font_context.rs @@ -4,14 +4,7 @@ use malloc_size_of::malloc_size_of_is_0; -#[derive(Clone, Debug)] +#[derive(Clone, Debug, Default)] pub struct FontContextHandle; -impl FontContextHandle { - // *shrug* - pub fn new() -> FontContextHandle { - FontContextHandle {} - } -} - malloc_size_of_is_0!(FontContextHandle);