From 17c3bbd51ca2a6ac1c6884692220e45a3d890cb8 Mon Sep 17 00:00:00 2001 From: Okko Hakola Date: Fri, 20 Dec 2024 14:47:59 +0200 Subject: [PATCH] Fix lints --- src/device_context.rs | 15 +++------------ src/window.rs | 5 +---- 2 files changed, 4 insertions(+), 16 deletions(-) diff --git a/src/device_context.rs b/src/device_context.rs index 69bab06..9ff1c7f 100644 --- a/src/device_context.rs +++ b/src/device_context.rs @@ -72,10 +72,7 @@ impl DeviceContext { ..Default::default() }); let (adapter, device, queue) = - match Self::create_adapter_device_and_queue(config, &instance, None) { - Ok(adq) => adq, - Err(e) => return Err(e), - }; + Self::create_adapter_device_and_queue(config, &instance, None)?; let sampler_nearest_repeat = Arc::new(device.create_sampler(&SamplerDescriptor { label: None, address_mode_u: AddressMode::Repeat, @@ -129,14 +126,8 @@ impl DeviceContext { /// If adapter, device and queue has been created without a window (surface), recreate them /// once you have a surface to ensure compatibility of queue families. pub fn reconfigure_with_surface(&mut self, surface: &Surface) -> Result<(), GlassError> { - let (adapter, device, queue) = match Self::create_adapter_device_and_queue( - &self.config, - &self.instance, - Some(surface), - ) { - Ok(adq) => adq, - Err(e) => return Err(e), - }; + let (adapter, device, queue) = + Self::create_adapter_device_and_queue(&self.config, &self.instance, Some(surface))?; self.adapter = adapter; self.device = Arc::new(device); self.queue = Arc::new(queue); diff --git a/src/window.rs b/src/window.rs index cf9e09f..74cdc4c 100644 --- a/src/window.rs +++ b/src/window.rs @@ -87,10 +87,7 @@ impl GlassWindow { window: Arc, ) -> Result { let size = [window.inner_size().width, window.inner_size().height]; - let surface = match context.instance().create_surface(window.clone()) { - Ok(surface) => surface, - Err(e) => return Err(e), - }; + let surface = context.instance().create_surface(window.clone())?; let allowed_formats = GlassWindow::allowed_surface_formats(); if !(config.surface_format == allowed_formats[0] || config.surface_format == allowed_formats[1])