From ef93327e6bbc55db4e28551c44bb2cdf9a74acf9 Mon Sep 17 00:00:00 2001 From: Arthur Beck Date: Fri, 21 Feb 2025 06:46:21 -0600 Subject: [PATCH] Format code --- kernel/build.rs | 4 +++- kernel/src/kernel/mem.rs | 6 ++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/kernel/build.rs b/kernel/build.rs index 293a38e..4580ace 100644 --- a/kernel/build.rs +++ b/kernel/build.rs @@ -40,7 +40,9 @@ fn main() { println!(r#"cargo:rustc-check-cfg=cfg(CONFIG_BUILD_GRUB, values("true", "false", none()))"#); - println!(r#"cargo:rustc-check-cfg=cfg(CONFIG_MEMORY_UNION_ALL, values("true", "false", none()))"#); + println!( + r#"cargo:rustc-check-cfg=cfg(CONFIG_MEMORY_UNION_ALL, values("true", "false", none()))"# + ); // End checks // Configuration name used when a config is required but should always evaluate to true diff --git a/kernel/src/kernel/mem.rs b/kernel/src/kernel/mem.rs index ce696fd..0bec433 100644 --- a/kernel/src/kernel/mem.rs +++ b/kernel/src/kernel/mem.rs @@ -78,14 +78,16 @@ fn get_allocator() -> Option<&'static MemoryMapAlloc<'static>> { /// The unsafe counterpart of [MemMapAlloc()]. Doesn't check if the allocator is initalized. /// Internally, uses [MaybeUninit::assume_init_ref]. -/// +/// /// # Safety /// /// Calling this instead of [MemMapAlloc] or when the allocator is uninitalized causes /// undefined behavior; check [MaybeUninit::assume_init_ref] for safety guarantees. pub unsafe fn get_allocator_unchecked() -> &'static MemoryMapAlloc<'static> { #[allow(static_mut_refs)] - unsafe { ALLOCATOR.assume_init_ref() } + unsafe { + ALLOCATOR.assume_init_ref() + } } #[kernel_item(MemMapAllocInit)]