Skip to content

Commit

Permalink
Fix lints
Browse files Browse the repository at this point in the history
  • Loading branch information
hakolao committed Dec 20, 2024
1 parent 6b2fde5 commit 17c3bbd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 16 deletions.
15 changes: 3 additions & 12 deletions src/device_context.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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);
Expand Down
5 changes: 1 addition & 4 deletions src/window.rs
Original file line number Diff line number Diff line change
Expand Up @@ -87,10 +87,7 @@ impl GlassWindow {
window: Arc<Window>,
) -> Result<GlassWindow, CreateSurfaceError> {
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])
Expand Down

0 comments on commit 17c3bbd

Please sign in to comment.