mirror of
https://github.com/emilk/egui.git
synced 2026-06-27 15:13:12 -04:00
misc clippy fixes from 1.60.0
This commit is contained in:
@@ -250,7 +250,9 @@ fn line_break(
|
||||
|
||||
if row_start_idx < paragraph.glyphs.len() {
|
||||
if non_empty_rows == job.wrap.max_rows {
|
||||
replace_last_glyph_with_overflow_character(fonts, job, out_rows);
|
||||
if let Some(last_row) = out_rows.last_mut() {
|
||||
replace_last_glyph_with_overflow_character(fonts, job, last_row);
|
||||
}
|
||||
} else {
|
||||
let glyphs: Vec<Glyph> = paragraph.glyphs[row_start_idx..]
|
||||
.iter()
|
||||
@@ -277,18 +279,13 @@ fn line_break(
|
||||
fn replace_last_glyph_with_overflow_character(
|
||||
fonts: &mut FontsImpl,
|
||||
job: &LayoutJob,
|
||||
out_rows: &mut Vec<Row>,
|
||||
row: &mut Row,
|
||||
) {
|
||||
let overflow_character = match job.wrap.overflow_character {
|
||||
Some(c) => c,
|
||||
None => return,
|
||||
};
|
||||
|
||||
let row = match out_rows.last_mut() {
|
||||
Some(r) => r,
|
||||
None => return,
|
||||
};
|
||||
|
||||
loop {
|
||||
let (prev_glyph, last_glyph) = match row.glyphs.as_mut_slice() {
|
||||
[.., prev, last] => (Some(prev), last),
|
||||
|
||||
Reference in New Issue
Block a user