1
0
mirror of https://github.com/emilk/egui.git synced 2026-09-01 14:20:04 -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

@@ -161,12 +161,12 @@ impl ImageLoader for ImageCrateLoader {
match ctx.try_load_bytes(uri) {
Ok(BytesPoll::Ready { bytes, mime, .. }) => {
// (2)
if let Some(mime) = mime {
if !is_supported_mime(&mime) {
return Err(LoadError::FormatNotSupported {
detected_format: Some(mime),
});
}
if let Some(mime) = mime
&& !is_supported_mime(&mime)
{
return Err(LoadError::FormatNotSupported {
detected_format: Some(mime),
});
}
load_image(ctx, uri, &self.cache, &bytes)
}