1
0
mirror of https://github.com/emilk/egui.git synced 2026-08-31 05: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

@@ -113,13 +113,11 @@ pub fn layout(fonts: &mut FontsImpl, pixels_per_point: f32, job: Arc<LayoutJob>)
let mut elided = false;
let mut rows = rows_from_paragraphs(paragraphs, &job, &mut elided);
if elided {
if let Some(last_placed) = rows.last_mut() {
let last_row = Arc::make_mut(&mut last_placed.row);
replace_last_glyph_with_overflow_character(fonts, pixels_per_point, &job, last_row);
if let Some(last) = last_row.glyphs.last() {
last_row.size.x = last.max_x();
}
if elided && let Some(last_placed) = rows.last_mut() {
let last_row = Arc::make_mut(&mut last_placed.row);
replace_last_glyph_with_overflow_character(fonts, pixels_per_point, &job, last_row);
if let Some(last) = last_row.glyphs.last() {
last_row.size.x = last.max_x();
}
}