Skip to content

Commit 28706a8

Browse files
uefi: Fix warnings when compiling without the alloc feature
1 parent baa7b48 commit 28706a8

File tree

2 files changed

+14
-9
lines changed

2 files changed

+14
-9
lines changed

uefi/src/proto/device_path/mod.rs

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,20 +81,23 @@ pub use device_path_gen::{
8181
acpi, bios_boot_spec, end, hardware, media, messaging, DevicePathNodeEnum,
8282
};
8383

84+
use crate::proto::{unsafe_protocol, ProtocolPointer};
8485
use core::ffi::c_void;
8586
use core::fmt::{self, Debug, Display, Formatter};
8687
use core::mem;
8788
use core::ops::Deref;
8889
use ptr_meta::Pointee;
89-
use uefi::table::boot::ScopedProtocol;
90-
#[cfg(feature = "alloc")]
91-
use {alloc::borrow::ToOwned, alloc::boxed::Box, uefi::CString16};
9290

93-
use crate::prelude::BootServices;
94-
use crate::proto::device_path::text::{AllowShortcuts, DevicePathToText, DisplayOnly};
95-
use crate::proto::{unsafe_protocol, ProtocolPointer};
96-
use crate::table::boot::{OpenProtocolAttributes, OpenProtocolParams, SearchType};
97-
use crate::Identify;
91+
#[cfg(feature = "alloc")]
92+
use {
93+
crate::proto::device_path::text::{AllowShortcuts, DevicePathToText, DisplayOnly},
94+
crate::table::boot::{
95+
BootServices, OpenProtocolAttributes, OpenProtocolParams, ScopedProtocol, SearchType,
96+
},
97+
crate::{CString16, Identify},
98+
alloc::borrow::ToOwned,
99+
alloc::boxed::Box,
100+
};
98101

99102
opaque_type! {
100103
/// Opaque type that should be used to represent a pointer to a
@@ -807,6 +810,7 @@ impl core::error::Error for DevicePathToTextError {
807810

808811
/// Helper function to open the [`DevicePathToText`] protocol using the boot
809812
/// services.
813+
#[cfg(feature = "alloc")]
810814
fn open_text_protocol(
811815
bs: &BootServices,
812816
) -> Result<ScopedProtocol<DevicePathToText>, DevicePathToTextError> {

uefi/src/table/runtime.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
33
use super::Revision;
44
use crate::table::boot::MemoryDescriptor;
5-
use crate::{CStr16, Error, Guid, Result, Status, StatusExt};
5+
use crate::{CStr16, Error, Result, Status, StatusExt};
66
use core::fmt::{Debug, Formatter};
77
use core::mem::MaybeUninit;
88
use core::{fmt, ptr};
@@ -15,6 +15,7 @@ pub use uefi_raw::time::Daylight;
1515
#[cfg(feature = "alloc")]
1616
use {
1717
crate::data_types::FromSliceWithNulError,
18+
crate::Guid,
1819
alloc::boxed::Box,
1920
alloc::{vec, vec::Vec},
2021
core::mem,

0 commit comments

Comments
 (0)