1
0
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:
Emil Ernerfeldt
2025-10-02 19:47:00 +02:00
committed by GitHub
parent 4c1f344ef8
commit bd45406fad
45 changed files with 812 additions and 847 deletions

View File

@@ -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 {