From 8237dfc8c6aca8845f2ad8247488a8ca9f84b72b Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 10 Apr 2021 07:32:56 -0700 Subject: [PATCH] fonts: fix compilation on win32 --- wezterm-font/src/locator/gdi.rs | 2 +- wezterm-font/src/locator/mod.rs | 20 +++++++++++++++++++- 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/wezterm-font/src/locator/gdi.rs b/wezterm-font/src/locator/gdi.rs index 5e2debb1d..576d159f9 100644 --- a/wezterm-font/src/locator/gdi.rs +++ b/wezterm-font/src/locator/gdi.rs @@ -57,7 +57,7 @@ fn extract_font_data(font: HFONT, attr: &FontAttributes) -> anyhow::Result, + data: Arc>, }, } @@ -176,3 +176,21 @@ impl FontLocator for NopSystemSource { Ok(vec![]) } } + +#[cfg(test)] +mod test { + use super::*; + + #[test] + fn test_memory_datasource() { + // This is currently only used on Windows, so make sure + // that we have compiler coverage of constructing it on + // other systems + let data = b"hello".to_vec(); + let source = FontDataSource::Memory { + data: Arc::new(data.into_boxed_slice()), + name: "hello!".to_string(), + }; + eprintln!("{:?}", source); + } +}