diff --git a/plotters/src/style/font/ttf.rs b/plotters/src/style/font/ttf.rs index 3ace93cd..8087293f 100644 --- a/plotters/src/style/font/ttf.rs +++ b/plotters/src/style/font/ttf.rs @@ -132,16 +132,13 @@ fn load_font_data(face: FontFamily, style: FontStyle) -> FontResult { // Then we need to check if the data cache contains the font data let cache = DATA_CACHE.read().unwrap(); if let Some(data) = cache.get(Borrow::::borrow(&key)) { - let font_ext = data.clone().map(|handle| { + data.clone().map(|handle| { handle .load() .map(FontExt::new) .map_err(|e| FontError::FontLoadError(Arc::new(e))) - })?; + })??; - if font_ext.is_err() { - return font_ext; - } } drop(cache);