From 79143a6295724ef5eee838a6d64b056fd12b6505 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sun, 3 Nov 2019 23:55:51 -0700 Subject: [PATCH] cargo fmt is a strict one --- src/allocation.rs | 4 ++-- tests/cast_slice_tests.rs | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/allocation.rs b/src/allocation.rs index 856fd40..864a12b 100644 --- a/src/allocation.rs +++ b/src/allocation.rs @@ -44,9 +44,9 @@ pub fn try_cast_box(input: Box) -> Result, (PodCastErr /// turns it into a Box. In other words, it's 100% assured that the zeroed data /// won't be put temporarily on the stack. You can make a box of any size /// without fear of a stack overflow. -/// +/// /// ## Failure -/// +/// /// This fails if the allocation fails. #[inline] pub fn try_zeroed_box() -> Result, ()> { diff --git a/tests/cast_slice_tests.rs b/tests/cast_slice_tests.rs index 2c3d123..1177a7f 100644 --- a/tests/cast_slice_tests.rs +++ b/tests/cast_slice_tests.rs @@ -43,6 +43,7 @@ fn test_try_cast_slice_mut() { let u32_slice: &mut [u32] = &mut [4, 5, 6]; let u32_len = u32_slice.len(); let u32_ptr = u32_slice.as_ptr(); + // the same data as align1 let the_bytes: &mut [u8] = try_cast_slice_mut(u32_slice).unwrap(); let the_bytes_len = the_bytes.len();