uidev: re-format code

This commit is contained in:
Aleksander
2025-09-13 12:18:27 +02:00
parent 1d8f8aca3e
commit c2628c0a15
7 changed files with 440 additions and 440 deletions

8
uidev/.editorconfig Normal file
View File

@@ -0,0 +1,8 @@
root = true
[*.rs]
indent_style = tab
indent_size = 2
charset = utf-8
trim_trailing_whitespace = false
insert_final_newline = false

2
uidev/rustfmt.toml Normal file
View File

@@ -0,0 +1,2 @@
tab_spaces = 2
hard_tabs = true

View File

@@ -13,8 +13,7 @@ use vulkano::{
format::Format,
image::{ImageUsage, view::ImageView},
swapchain::{
Surface, SurfaceInfo, Swapchain, SwapchainCreateInfo, SwapchainPresentInfo,
acquire_next_image,
Surface, SurfaceInfo, Swapchain, SwapchainCreateInfo, SwapchainPresentInfo, acquire_next_image,
},
sync::GpuFuture,
};
@@ -242,8 +241,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
swapchain_create_info.image_extent = swapchain_size;
(swapchain, images) = {
let (swapchain, images) =
swapchain.recreate(swapchain_create_info.clone()).unwrap();
let (swapchain, images) = swapchain.recreate(swapchain_create_info.clone()).unwrap();
let image_views = images
.into_iter()
@@ -286,12 +284,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
profiler.start();
{
let (image_index, _, acquire_future) = match acquire_next_image(
swapchain.clone(),
None,
)
.map_err(Validated::unwrap)
{
let (image_index, _, acquire_future) =
match acquire_next_image(swapchain.clone(), None).map_err(Validated::unwrap) {
Ok(r) => r,
Err(VulkanError::OutOfDate) => {
recreate = true;
@@ -321,10 +315,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
.unwrap()
.then_swapchain_present(
gfx.queue_gfx.clone(),
SwapchainPresentInfo::swapchain_image_index(
swapchain.clone(),
image_index,
),
SwapchainPresentInfo::swapchain_image_index(swapchain.clone(), image_index),
)
.then_signal_fence_and_flush()
.unwrap()

View File

@@ -15,10 +15,7 @@ pub struct TestbedAny {
}
impl TestbedAny {
pub fn new(
name: &str,
listeners: &mut EventListenerCollection<(), ()>,
) -> anyhow::Result<Self> {
pub fn new(name: &str, listeners: &mut EventListenerCollection<(), ()>) -> anyhow::Result<Self> {
let path = format!("gui/{name}.xml");
let globals = WguiGlobals::new(Box::new(assets::Asset {}))?;
@@ -37,7 +34,8 @@ impl TestbedAny {
impl Testbed for TestbedAny {
fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> {
self.layout
self
.layout
.update(Vec2::new(width, height), timestep_alpha)?;
Ok(())
}

View File

@@ -121,7 +121,8 @@ impl TestbedGeneric {
impl Testbed for TestbedGeneric {
fn update(&mut self, width: f32, height: f32, timestep_alpha: f32) -> anyhow::Result<()> {
self.layout
self
.layout
.update(Vec2::new(width, height), timestep_alpha)?;
Ok(())
}