Skip to content

Commit

Permalink
Simplification, now using ??.
Browse files Browse the repository at this point in the history
  • Loading branch information
martinfrances107 committed Oct 18, 2023
1 parent 33257bf commit 4ac399e
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions plotters/src/style/font/ttf.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,16 +132,13 @@ fn load_font_data(face: FontFamily, style: FontStyle) -> FontResult<FontExt> {
// 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::<str>::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);

Expand Down

0 comments on commit 4ac399e

Please sign in to comment.