Skip to content

Commit e1b5134

Browse files
committed
Fix Clippy warning related to vector initialization
1 parent 3355de2 commit e1b5134

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

uefi-test-runner/src/main.rs

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -115,13 +115,8 @@ fn shutdown(image: uefi::Handle, st: SystemTable<Boot>) -> ! {
115115
}
116116

117117
// Exit boot services as a proof that it works :)
118-
use crate::alloc::vec::Vec;
119118
let max_mmap_size = st.boot_services().memory_map_size() + 1024;
120-
let mut mmap_storage = unsafe {
121-
let mut mmap_storage = Vec::with_capacity(max_mmap_size);
122-
mmap_storage.set_len(max_mmap_size);
123-
mmap_storage.into_boxed_slice()
124-
};
119+
let mut mmap_storage = vec![0; max_mmap_size].into_boxed_slice();
125120
let (st, _iter) = st
126121
.exit_boot_services(image, &mut mmap_storage[..])
127122
.expect_success("Failed to exit boot services");

0 commit comments

Comments
 (0)