diff options
author | 2022-07-03 15:27:23 +0200 | |
---|---|---|
committer | 2022-07-03 15:27:23 +0200 | |
commit | 2010977bd20fe5f562e0389f24c5aa284d89e25c (patch) | |
tree | c3a70d9385a4bec4f1aa996c307613e55aaa22a6 /examples | |
parent | 8b250d12e70f13240efd0f56828d06ab8ef78071 (diff) | |
download | iced-2010977bd20fe5f562e0389f24c5aa284d89e25c.tar.gz iced-2010977bd20fe5f562e0389f24c5aa284d89e25c.tar.bz2 iced-2010977bd20fe5f562e0389f24c5aa284d89e25c.zip |
Use `expect` in `integration_wgpu` example
... together with `first` and `copied`.
Diffstat (limited to 'examples')
-rw-r--r-- | examples/integration_wgpu/src/main.rs | 6 |
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 { |