Use find(..) instead of filter(..).next()

This commit is contained in:
Héctor Ramón Jiménez 2023-04-21 21:46:02 +02:00
parent 3f0c226b74
commit cc20baad6f
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
2 changed files with 2 additions and 4 deletions

View file

@ -99,8 +99,7 @@ pub fn main() -> Result<(), Box<dyn std::error::Error>> {
.formats
.iter()
.copied()
.filter(wgpu::TextureFormat::is_srgb)
.next()
.find(wgpu::TextureFormat::is_srgb)
.or_else(|| capabilities.formats.first().copied())
.expect("Get preferred format"),
adapter

View file

@ -72,8 +72,7 @@ impl<Theme> Compositor<Theme> {
.formats
.iter()
.copied()
.filter(wgpu::TextureFormat::is_srgb)
.next()
.find(wgpu::TextureFormat::is_srgb)
.or_else(|| {
log::warn!("No sRGB format found!");