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

Enable more clippy lints

This commit is contained in:
Emil Ernerfeldt
2022-07-26 11:18:21 +02:00
parent a7012cf8a6
commit 8e2de26e4e
6 changed files with 25 additions and 22 deletions

View File

@@ -90,15 +90,13 @@ impl LineDemo {
ComboBox::from_label("Line style")
.selected_text(line_style.to_string())
.show_ui(ui, |ui| {
for style in [
for style in &[
LineStyle::Solid,
LineStyle::dashed_dense(),
LineStyle::dashed_loose(),
LineStyle::dotted_dense(),
LineStyle::dotted_loose(),
]
.iter()
{
] {
ui.selectable_value(line_style, *style, style.to_string());
}
});

View File

@@ -29,10 +29,10 @@ pub fn highlight(ctx: &egui::Context, theme: &CodeTheme, code: &str, language: &
}
}
type HighlightCache<'a> = egui::util::cache::FrameCache<LayoutJob, Highlighter>;
type HighlightCache = egui::util::cache::FrameCache<LayoutJob, Highlighter>;
let mut memory = ctx.memory();
let highlight_cache = memory.caches.cache::<HighlightCache<'_>>();
let highlight_cache = memory.caches.cache::<HighlightCache>();
highlight_cache.get((theme, code, language))
}