From 8594268fc2d77bce3d76228cd32a5e2d49fbaad5 Mon Sep 17 00:00:00 2001 From: Andrea Ciliberti Date: Wed, 23 Nov 2022 16:29:06 +0100 Subject: [PATCH] Cargo fmt --- ctru-rs/src/linear.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/ctru-rs/src/linear.rs b/ctru-rs/src/linear.rs index a913f27..da91eb7 100644 --- a/ctru-rs/src/linear.rs +++ b/ctru-rs/src/linear.rs @@ -7,7 +7,7 @@ //!
//! -use std::alloc::{Allocator, AllocError, Layout}; +use std::alloc::{AllocError, Allocator, Layout}; use std::ptr::NonNull; // Implementing an `std::alloc::Allocator` type is the best way to handle this case, since it gives @@ -27,11 +27,9 @@ impl LinearAllocator { } unsafe impl Allocator for LinearAllocator { - fn allocate( - &self, - layout: Layout, - ) -> Result, AllocError> { - let pointer = unsafe { ctru_sys::linearMemAlign(layout.size() as u32, layout.align() as u32) }; + fn allocate(&self, layout: Layout) -> Result, AllocError> { + let pointer = + unsafe { ctru_sys::linearMemAlign(layout.size() as u32, layout.align() as u32) }; NonNull::new(pointer.cast()) .map(|ptr| NonNull::slice_from_raw_parts(ptr, layout.size()))