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:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user