1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-29 04:40:03 -04:00

Use a lot more let-else (#7582)

This commit is contained in:
Emil Ernerfeldt
2025-10-02 19:47:00 +02:00
committed by GitHub
parent 4c1f344ef8
commit bd45406fad
45 changed files with 812 additions and 847 deletions

View File

@@ -239,17 +239,17 @@ impl FontImpl {
return None; // these will result in the replacement character when rendering
}
if c == '\t' {
if let Some(space) = self.glyph_info(' ') {
let glyph_info = GlyphInfo {
advance_width_unscaled: (crate::text::TAB_SIZE as f32
* space.advance_width_unscaled.0)
.into(),
..space
};
self.glyph_info_cache.insert(c, glyph_info);
return Some(glyph_info);
}
if c == '\t'
&& let Some(space) = self.glyph_info(' ')
{
let glyph_info = GlyphInfo {
advance_width_unscaled: (crate::text::TAB_SIZE as f32
* space.advance_width_unscaled.0)
.into(),
..space
};
self.glyph_info_cache.insert(c, glyph_info);
return Some(glyph_info);
}
if c == '\u{2009}' {