Skip to content

Commit b3d031a

Browse files
committed
uefi: boot-policy: derive Default
1 parent 8f0a6b5 commit b3d031a

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

uefi/src/proto/boot_policy.rs

+2-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ impl core::error::Error for BootPolicyError {}
2828
///
2929
/// This type is not ABI compatible. On the ABI level, this is an UEFI
3030
/// boolean.
31-
#[derive(Debug, Copy, Clone, PartialOrd, PartialEq, Eq, Ord)]
31+
#[derive(Copy, Clone, Debug, Default, Eq, Ord, PartialEq, PartialOrd)]
3232
pub enum BootPolicy {
3333
/// Indicates that the request originates from the boot manager, and that
3434
/// the boot manager is attempting to load the provided `file_path` as a
@@ -41,6 +41,7 @@ pub enum BootPolicy {
4141
/// The provided `file_path` must match an exact file to be loaded.
4242
///
4343
/// This corresponds to the `FALSE` value in the UEFI spec.
44+
#[default]
4445
ExactMatch,
4546
}
4647

uefi/src/table/boot.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1419,7 +1419,7 @@ impl<'a> LoadImageSource<'a> {
14191419
match self {
14201420
LoadImageSource::FromBuffer { buffer, file_path } => {
14211421
// Boot policy is ignored when loading from source buffer.
1422-
boot_policy = BootPolicy::ExactMatch;
1422+
boot_policy = BootPolicy::default();
14231423

14241424
device_path = file_path.map(|p| p.as_ffi_ptr()).unwrap_or(ptr::null());
14251425
source_buffer = buffer.as_ptr();

0 commit comments

Comments
 (0)