1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -04:00

Clippy fixes

This commit is contained in:
Emil Ernerfeldt
2022-03-21 21:48:35 +01:00
parent 339b28b470
commit 5c68edbb15
7 changed files with 20 additions and 13 deletions

View File

@@ -17,7 +17,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
demo_windows.ui(ctx);
});
ctx.tessellate(full_output.shapes)
})
});
});
c.bench_function("demo_no_tessellate", |b| {
@@ -25,14 +25,14 @@ pub fn criterion_benchmark(c: &mut Criterion) {
ctx.run(RawInput::default(), |ctx| {
demo_windows.ui(ctx);
})
})
});
});
let full_output = ctx.run(RawInput::default(), |ctx| {
demo_windows.ui(ctx);
});
c.bench_function("demo_only_tessellate", |b| {
b.iter(|| ctx.tessellate(full_output.shapes.clone()))
b.iter(|| ctx.tessellate(full_output.shapes.clone()));
});
}
@@ -45,7 +45,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
ctx.run(RawInput::default(), |ctx| {
demo_windows.ui(ctx);
})
})
});
});
}
@@ -56,12 +56,12 @@ pub fn criterion_benchmark(c: &mut Criterion) {
c.bench_function("label &str", |b| {
b.iter(|| {
ui.label("the quick brown fox jumps over the lazy dog");
})
});
});
c.bench_function("label format!", |b| {
b.iter(|| {
ui.label("the quick brown fox jumps over the lazy dog".to_owned());
})
});
});
});
});
@@ -77,7 +77,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
let rect = ui.max_rect();
b.iter(|| {
painter.rect(rect, 2.0, egui::Color32::RED, (1.0, egui::Color32::WHITE));
})
});
});
});
@@ -108,7 +108,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
wrap_width,
);
layout(&mut locked_fonts.fonts, job.into())
})
});
});
}
c.bench_function("text_layout_cached", |b| {
@@ -119,7 +119,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
color,
wrap_width,
)
})
});
});
let galley = fonts.layout(LOREM_IPSUM_LONG.to_owned(), font_id, color, wrap_width);
@@ -131,7 +131,7 @@ pub fn criterion_benchmark(c: &mut Criterion) {
b.iter(|| {
tessellator.tessellate_text(font_image_size, &text_shape, &mut mesh);
mesh.clear();
})
});
});
}
}