From b0ad77a14e903e49afdafeb83ff94082d46437bc Mon Sep 17 00:00:00 2001 From: peamaeq Date: Thu, 23 Jun 2022 23:40:52 +0800 Subject: [PATCH] Shrink unsafe blocks --- crates/building_blocks_storage/src/array.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/building_blocks_storage/src/array.rs b/crates/building_blocks_storage/src/array.rs index f56409c..e23d7b3 100644 --- a/crates/building_blocks_storage/src/array.rs +++ b/crates/building_blocks_storage/src/array.rs @@ -377,8 +377,8 @@ where { /// Create a new array for `extent` where each point's value is determined by the `filler` function. pub fn fill_with(extent: ExtentN, mut filler: impl FnMut(PointN) -> Chan::Data) -> Self { + let mut array = unsafe { Array::<_, UninitChan>::maybe_uninit(extent) }; unsafe { - let mut array = Array::<_, UninitChan>::maybe_uninit(extent); array.for_each_mut_ptr(&extent, |p, val| { val.into_multi_mut_ptr().write(filler(p));