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:
@@ -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)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user