Skip to content

Commit ba89b71

Browse files
committed
mem: add sane default parameter
This doesn't solve any real problem right now, but it seems to be the right thing to do. This also is the default for the types in the `alloc` crate.
1 parent fcfe676 commit ba89b71

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

uefi/src/mem/util.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ use core::slice;
99

1010
#[cfg(not(feature = "unstable"))]
1111
use ::alloc::alloc::{alloc, dealloc};
12+
#[cfg(feature = "unstable")]
13+
use alloc::alloc::Global;
1214

1315
#[cfg(feature = "unstable")]
1416
use {core::alloc::Allocator, core::ptr::NonNull};
@@ -39,7 +41,7 @@ pub(crate) fn make_boxed<
3941
// The UEFI data structure.
4042
Data: Align + ?Sized + Debug + 'a,
4143
F: FnMut(&'a mut [u8]) -> Result<&'a mut Data, Option<usize>>,
42-
#[cfg(feature = "unstable")] A: Allocator,
44+
#[cfg(feature = "unstable")] A: Allocator = Global,
4345
>(
4446
// A function to read the UEFI data structure into a provided buffer.
4547
mut fetch_data_fn: F,

0 commit comments

Comments
 (0)