better than repetitive if statements

macos-click-through
exoticus 5 years ago
parent 2975d599bd
commit f0cc8cd696

@ -176,20 +176,16 @@ pub fn build_collection_by_font_name(
} }
} }
if let Some(family) = loader.get_or_load(SYSTEM_SYMBOL_FONT, false) { for font in &[SYSTEM_SYMBOL_FONT, SYSTEM_EMOJI_FONT] {
collection.add_family(family.to_family()); if let Some(family) = loader.get_or_load(font, false) {
} collection.add_family(family.to_family());
}
if let Some(family) = loader.get_or_load(SYSTEM_EMOJI_FONT, false) {
collection.add_family(family.to_family());
}
if let Some(family) = loader.get_or_load(EXTRA_SYMBOL_FONT, true) {
collection.add_family(family.to_family());
} }
if let Some(family) = loader.get_or_load(MISSING_GLYPH_FONT, true) { for font in &[EXTRA_SYMBOL_FONT, MISSING_GLYPH_FONT] {
collection.add_family(family.to_family()); if let Some(family) = loader.get_or_load(font, true) {
collection.add_family(family.to_family());
}
} }
collection collection

Loading…
Cancel
Save