1
0
mirror of https://github.com/emilk/egui.git synced 2026-06-26 22:53:14 -04:00

Flip if-else:s with a negation (#8063)

This commit is contained in:
Emil Ernerfeldt
2026-04-04 12:03:41 +02:00
committed by GitHub
parent eb35f7d12f
commit c2b482ff7e
9 changed files with 44 additions and 44 deletions

View File

@@ -50,10 +50,10 @@ impl eframe::App for MyApp {
for file in &self.dropped_files {
let mut info = if let Some(path) = &file.path {
path.display().to_string()
} else if !file.name.is_empty() {
file.name.clone()
} else {
} else if file.name.is_empty() {
"???".to_owned()
} else {
file.name.clone()
};
let mut additional_info = vec![];
@@ -95,10 +95,10 @@ fn preview_files_being_dropped(ctx: &egui::Context) {
for file in &i.raw.hovered_files {
if let Some(path) = &file.path {
write!(text, "\n{}", path.display()).ok();
} else if !file.mime.is_empty() {
write!(text, "\n{}", file.mime).ok();
} else {
} else if file.mime.is_empty() {
text += "\n???";
} else {
write!(text, "\n{}", file.mime).ok();
}
}
text