From 1c294bf527921e17c8c6ab25c33f3a046f1691ae 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 | 10 ++-------- components/gfx/platform/windows/font_context.rs | 9 +-------- 2 files changed, 3 insertions(+), 16 deletions(-) diff --git a/components/gfx/platform/macos/font_context.rs b/components/gfx/platform/macos/font_context.rs index 753cb97a572d..b296ce6738b8 100644 --- a/components/gfx/platform/macos/font_context.rs +++ b/components/gfx/platform/macos/font_context.rs @@ -4,16 +4,10 @@ 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: () } - } + _ctx: (), } impl MallocSizeOf for FontContextHandle { diff --git a/components/gfx/platform/windows/font_context.rs b/components/gfx/platform/windows/font_context.rs index d5e0015dd562..a67a366fc119 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);