Use for-loop instead of Iterator::for_each

This commit is contained in:
Emil Ernerfeldt 2021-10-20 16:34:43 +02:00
parent 40445c450c
commit ab3be8aca3

View file

@ -79,7 +79,7 @@ impl LineDemo {
ComboBox::from_label("Line style") ComboBox::from_label("Line style")
.selected_text(line_style.to_string()) .selected_text(line_style.to_string())
.show_ui(ui, |ui| { .show_ui(ui, |ui| {
[ for style in [
LineStyle::Solid, LineStyle::Solid,
LineStyle::dashed_dense(), LineStyle::dashed_dense(),
LineStyle::dashed_loose(), LineStyle::dashed_loose(),
@ -87,9 +87,9 @@ impl LineDemo {
LineStyle::dotted_loose(), LineStyle::dotted_loose(),
] ]
.iter() .iter()
.for_each(|style| { {
ui.selectable_value(line_style, *style, style.to_string()); ui.selectable_value(line_style, *style, style.to_string());
}); }
}); });
}); });
}); });