summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-21 21:46:02 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-04-21 21:46:02 +0200
commitcc20baad6f422271f052cf68474a4aee40dcdc82 (patch)
tree097a2d7b274ae4de451e7886ff7e641e3f47af79
parent3f0c226b74c6d0271e550161b6542e652c1875ca (diff)
downloadiced-cc20baad6f422271f052cf68474a4aee40dcdc82.tar.gz
iced-cc20baad6f422271f052cf68474a4aee40dcdc82.tar.bz2
iced-cc20baad6f422271f052cf68474a4aee40dcdc82.zip
Use `find(..)` instead of `filter(..).next()`
-rw-r--r--examples/integration_wgpu/src/main.rs3
-rw-r--r--wgpu/src/window/compositor.rs3
2 files changed, 2 insertions, 4 deletions
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs
index f5fe7636..15901db8 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration_wgpu/src/main.rs
@@ -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
diff --git a/wgpu/src/window/compositor.rs b/wgpu/src/window/compositor.rs
index 3c51768a..53af19bf 100644
--- a/wgpu/src/window/compositor.rs
+++ b/wgpu/src/window/compositor.rs
@@ -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!");