mirror of
https://github.com/emilk/egui.git
synced 2026-06-26 22:53:14 -04:00
Use a lot more let-else (#7582)
This commit is contained in:
@@ -29,10 +29,10 @@ impl eframe::App for MyApp {
|
||||
egui::CentralPanel::default().show(ctx, |ui| {
|
||||
ui.label("Drag-and-drop files onto the window!");
|
||||
|
||||
if ui.button("Open file…").clicked() {
|
||||
if let Some(path) = rfd::FileDialog::new().pick_file() {
|
||||
self.picked_path = Some(path.display().to_string());
|
||||
}
|
||||
if ui.button("Open file…").clicked()
|
||||
&& let Some(path) = rfd::FileDialog::new().pick_file()
|
||||
{
|
||||
self.picked_path = Some(path.display().to_string());
|
||||
}
|
||||
|
||||
if let Some(picked_path) = &self.picked_path {
|
||||
|
||||
Reference in New Issue
Block a user