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))