From 0a1dd494095b6d39617f695ca4075d020e3e63ed Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 9 Jun 2019 07:44:02 -0700 Subject: [PATCH] more dyn courtesy of `cargo +nightly fix` --- src/font/coretext.rs | 6 +++--- src/font/fontloader_and_freetype.rs | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/font/coretext.rs b/src/font/coretext.rs index f91b60946..5380cc52b 100644 --- a/src/font/coretext.rs +++ b/src/font/coretext.rs @@ -48,7 +48,7 @@ impl FontSystem for CoreTextSystem { config: &Config, style: &TextStyle, font_scale: f64, - ) -> Result, Error> { + ) -> Result, Error> { let mut fonts = Vec::new(); for font_attr in style.font_with_fallback() { let col = match create_for_family(&font_attr.family) { @@ -80,11 +80,11 @@ impl FontSystem for CoreTextSystem { } impl NamedFont for NamedFontImpl { - fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> { + fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> { self.fonts .get(idx) .map(|f| { - let f: &Font = f; + let f: &dyn Font = f; f }) .ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx)) diff --git a/src/font/fontloader_and_freetype.rs b/src/font/fontloader_and_freetype.rs index df1b9e31c..48277f03a 100644 --- a/src/font/fontloader_and_freetype.rs +++ b/src/font/fontloader_and_freetype.rs @@ -36,7 +36,7 @@ impl FontSystem for FontLoaderAndFreeType { config: &Config, style: &TextStyle, font_scale: f64, - ) -> Result, Error> { + ) -> Result, Error> { let mut lib = ftwrap::Library::new()?; // Some systems don't support this mode, so if it fails, we don't // care to abort the rest of what we're doing @@ -70,11 +70,11 @@ impl FontSystem for FontLoaderAndFreeType { } impl NamedFont for NamedFontImpl { - fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&Font, Error> { + fn get_fallback(&mut self, idx: FallbackIdx) -> Result<&dyn Font, Error> { self.fonts .get(idx) .map(|f| { - let f: &Font = f; + let f: &dyn Font = f; f }) .ok_or_else(|| format_err!("no fallback fonts available (idx={})", idx))