Use expect in integration_wgpu example

... together with `first` and `copied`.
This commit is contained in:
Héctor Ramón Jiménez 2022-07-03 15:27:23 +02:00
parent 8b250d12e7
commit 2010977bd2
No known key found for this signature in database
GPG key ID: 140CC052C94F138E

View file

@ -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 {