From 2010977bd20fe5f562e0389f24c5aa284d89e25c Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 3 Jul 2022 15:27:23 +0200 Subject: Use `expect` in `integration_wgpu` example ... together with `first` and `copied`. --- examples/integration_wgpu/src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'examples/integration_wgpu/src/main.rs') 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 { -- cgit