From 0e69df29997165d4629255a40fa03ba0bc646823 Mon Sep 17 00:00:00 2001 From: Fan Jiang Date: Wed, 1 Apr 2020 01:14:32 -0400 Subject: [PATCH] Update format --- src/base/conversion.rs | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/base/conversion.rs b/src/base/conversion.rs index 15c0bf9d..30b68bb7 100644 --- a/src/base/conversion.rs +++ b/src/base/conversion.rs @@ -120,11 +120,9 @@ macro_rules! impl_from_into_asref_1D( fn into(self) -> [N; $SZ] { let mut res = mem::MaybeUninit::<[N; $SZ]>::uninit(); - unsafe { ptr::copy_nonoverlapping(self.data.ptr(), res.as_mut_ptr() as *mut N, $SZ); } + unsafe { ptr::copy_nonoverlapping(self.data.ptr(), res.as_mut_ptr() as *mut N, $SZ) }; - let res: [N; $SZ] = unsafe { res.assume_init() }; - - res + unsafe { res.assume_init() } } } @@ -188,11 +186,9 @@ macro_rules! impl_from_into_asref_2D( fn into(self) -> [[N; $SZRows]; $SZCols] { let mut res = mem::MaybeUninit::<[[N; $SZRows]; $SZCols]>::uninit(); - unsafe { ptr::copy_nonoverlapping(self.data.ptr(), res.as_mut_ptr() as *mut N, $SZRows * $SZCols); } + unsafe { ptr::copy_nonoverlapping(self.data.ptr(), res.as_mut_ptr() as *mut N, $SZRows * $SZCols) }; - let res: [[N; $SZRows]; $SZCols] = unsafe { res.assume_init() }; - - res + unsafe { res.assume_init() } } }