Skip to content

Commit

Permalink
Refactor: use if let instead of for on Options (emilk#4934)
Browse files Browse the repository at this point in the history
This is recommended by `rust-analyzer`

It might be a good idea to fix this to appease `rust-analyzer`.
  • Loading branch information
rustbasic authored Aug 26, 2024
1 parent 560b298 commit 555ea9f
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions crates/egui/src/context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1926,10 +1926,10 @@ impl Context {
paint_widget_id(widget, "hovered", Color32::WHITE);
}
}
for &widget in &clicked {
if let Some(widget) = clicked {
paint_widget_id(widget, "clicked", Color32::RED);
}
for &widget in &dragged {
if let Some(widget) = dragged {
paint_widget_id(widget, "dragged", Color32::GREEN);
}
}
Expand All @@ -1948,10 +1948,10 @@ impl Context {
paint_widget(widget, "contains_pointer", Color32::BLUE);
}
}
for widget in &click {
if let Some(widget) = &click {
paint_widget(widget, "click", Color32::RED);
}
for widget in &drag {
if let Some(widget) = &drag {
paint_widget(widget, "drag", Color32::GREEN);
}
}
Expand Down

0 comments on commit 555ea9f

Please sign in to comment.