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