Simplify format selection in iced_wgpu

This commit is contained in:
Héctor Ramón Jiménez 2022-07-03 15:30:04 +02:00
parent 2010977bd2
commit 3d38d0af91
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -60,12 +60,7 @@ impl Compositor {
log::info!("Selected: {:#?}", adapter.get_info());
let format = compatible_surface.as_ref().and_then(|surface| {
let formats = surface.get_supported_formats(&adapter);
if formats.is_empty() {
None
} else {
Some(formats[0])
}
surface.get_supported_formats(&adapter).first().copied()
})?;
log::info!("Selected format: {:?}", format);