Use find(..) instead of filter(..).next()
This commit is contained in:
parent
3f0c226b74
commit
cc20baad6f
2 changed files with 2 additions and 4 deletions
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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!");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue