summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-03 15:27:23 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2022-07-03 15:27:23 +0200
commit2010977bd20fe5f562e0389f24c5aa284d89e25c (patch)
treec3a70d9385a4bec4f1aa996c307613e55aaa22a6
parent8b250d12e70f13240efd0f56828d06ab8ef78071 (diff)
downloadiced-2010977bd20fe5f562e0389f24c5aa284d89e25c.tar.gz
iced-2010977bd20fe5f562e0389f24c5aa284d89e25c.tar.bz2
iced-2010977bd20fe5f562e0389f24c5aa284d89e25c.zip
Use `expect` in `integration_wgpu` example
... together with `first` and `copied`.
-rw-r--r--examples/integration_wgpu/src/main.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/examples/integration_wgpu/src/main.rs b/examples/integration_wgpu/src/main.rs
index 7235e72b..89ae03c6 100644
--- a/examples/integration_wgpu/src/main.rs
+++ b/examples/integration_wgpu/src/main.rs
@@ -89,7 +89,11 @@ pub fn main() {
let needed_limits = wgpu::Limits::default();
(
- surface.get_supported_formats(&adapter)[0],
+ surface
+ .get_supported_formats(&adapter)
+ .first()
+ .copied()
+ .expect("Get preferred format"),
adapter
.request_device(
&wgpu::DeviceDescriptor {