Skip to content

Commit

Permalink
Fixed some clippy formatting issues
Browse files Browse the repository at this point in the history
  • Loading branch information
ThomasJowett committed Jun 9, 2023
1 parent 370304c commit 4aca2ab
Showing 1 changed file with 8 additions and 11 deletions.
19 changes: 8 additions & 11 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ mod halvar {
swapchain::Surface,
VulkanLibrary,
device::{
physical::{PhysicalDevice, PhysicalDeviceType}, Device, DeviceCreateInfo, DeviceExtensions, QueueCreateInfo,
physical::{PhysicalDevice, PhysicalDeviceType}, DeviceExtensions,
QueueFlags,
},
};
Expand Down Expand Up @@ -53,7 +53,7 @@ mod halvar {

let required_extensions = vulkano_win::required_extensions(&library);

let instance = Instance::new(
Instance::new(
library,
InstanceCreateInfo {
enabled_extensions: required_extensions,
Expand All @@ -62,9 +62,7 @@ mod halvar {
..Default::default()
},
)
.unwrap();

return instance;
.unwrap()
}

pub fn choose_physical_device(instance: &Arc<Instance>, surface: &Arc<Surface>) -> Arc<PhysicalDevice> {
Expand All @@ -73,7 +71,7 @@ mod halvar {
..DeviceExtensions::empty()
};

let (physical_device, queue_family_index) = instance
let (physical_device, _queue_family_index) = instance
.enumerate_physical_devices()
.unwrap()
.filter(|p| {
Expand All @@ -85,7 +83,7 @@ mod halvar {
.enumerate()
.position(|(i, q)| {
q.queue_flags.intersects(QueueFlags::GRAPHICS)
&& p.surface_support(i as u32, &surface).unwrap_or(false)
&& p.surface_support(i as u32, surface).unwrap_or(false)
})
.map(|i| (p, i as u32))
})
Expand All @@ -107,7 +105,8 @@ mod halvar {
physical_device.properties().device_name,
physical_device.properties().device_type,
);
return physical_device;

physical_device
}

pub fn run(self) {
Expand All @@ -125,9 +124,7 @@ mod halvar {
.downcast_ref::<Window>()
.unwrap();
let dimensions = window.inner_size();
if dimensions.width == 0 || dimensions.height == 0 {
return;
}
if dimensions.width == 0 || dimensions.height == 0 {}
}
_ => (),
});
Expand Down

0 comments on commit 4aca2ab

Please sign in to comment.