Refactor: use if let instead of for on Options (#4934)

This is recommended by `rust-analyzer`

It might be a good idea to fix this to appease `rust-analyzer`.
This commit is contained in:
rustbasic
2024-08-26 22:31:26 +09:00
committed by GitHub
parent 560b2989a7
commit 555ea9f7aa
+4 -4
View File
@@ -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);
}
}
@@ -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);
}
}