From a2baf0abb37b9f4f30772e02907365caae161f90 Mon Sep 17 00:00:00 2001 From: Lokathor Date: Sat, 25 Jul 2020 15:50:10 -0600 Subject: [PATCH] use the correct (weaker) trait bound. --- src/allocation.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/allocation.rs b/src/allocation.rs index 1e33796..7930c32 100644 --- a/src/allocation.rs +++ b/src/allocation.rs @@ -85,7 +85,9 @@ pub fn zeroed_box() -> Box { /// /// This fails if the allocation fails. #[inline] -pub fn try_zeroed_slice_box(length: usize) -> Result, ()> { +pub fn try_zeroed_slice_box( + length: usize, +) -> Result, ()> { if size_of::() == 0 { // This will not allocate but simple create a dangling slice pointer. let mut vec = Vec::with_capacity(length); @@ -113,7 +115,7 @@ pub fn try_zeroed_slice_box(length: usize) -> Result, ()> { } /// As [`try_zeroed_slice_box`](try_zeroed_slice_box), but unwraps for you. -pub fn zeroed_slice_box(length: usize) -> Box<[T]> { +pub fn zeroed_slice_box(length: usize) -> Box<[T]> { try_zeroed_slice_box(length).unwrap() }