From 9bcd99e4377f3aab1e19f87bf1f3f6b5c05f49d9 Mon Sep 17 00:00:00 2001 From: Simon Gellis Date: Sat, 31 Oct 2026 01:06:20 -0400 Subject: [PATCH] Fix formatting --- src/emulator/shrooms_vb_util.rs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/emulator/shrooms_vb_util.rs b/src/emulator/shrooms_vb_util.rs index 5675324..6a93bba 100644 --- a/src/emulator/shrooms_vb_util.rs +++ b/src/emulator/shrooms_vb_util.rs @@ -1,4 +1,7 @@ -use std::{ffi::c_void, sync::{LazyLock, Mutex}}; +use std::{ + ffi::c_void, + sync::{LazyLock, Mutex}, +}; #[derive(Default)] struct Reallocator { @@ -55,7 +58,8 @@ impl Reallocator { // actually reallocate and copy the data over let mut new_data = Allocation::new(new_size); let bytes_to_copy = old_data.size.min(new_size); - new_data.as_mut_slice()[..bytes_to_copy].copy_from_slice(&old_data.as_slice()[..bytes_to_copy]); + new_data.as_mut_slice()[..bytes_to_copy] + .copy_from_slice(&old_data.as_slice()[..bytes_to_copy]); self.store_allocation(new_data) } } else if new_size > 0 { @@ -71,7 +75,11 @@ impl Reallocator { if ptr.is_null() { return None; } - let index = self.allocations.iter().enumerate().find_map(|(i, alloc)| std::ptr::addr_eq(alloc.ptr, ptr).then_some(i))?; + let index = self + .allocations + .iter() + .enumerate() + .find_map(|(i, alloc)| std::ptr::addr_eq(alloc.ptr, ptr).then_some(i))?; let allocation = self.allocations.remove(index); Some(allocation) } @@ -83,7 +91,8 @@ impl Reallocator { } } -static VBU_ALLOC: LazyLock> = LazyLock::new(|| Mutex::new(Reallocator::default())); +static VBU_ALLOC: LazyLock> = + LazyLock::new(|| Mutex::new(Reallocator::default())); #[unsafe(no_mangle)] #[allow(nonstandard_style)]