Skip to content

Commit b0e8dd2

Browse files
uefi: Clean up macro imports
All of the macros from uefi_macros are imported into the uefi crate. Consistently use those imports everywhere, rather than reimporting from `uefi_macros`.
1 parent 0c533bd commit b0e8dd2

File tree

11 files changed

+13
-18
lines changed

11 files changed

+13
-18
lines changed

uefi/src/data_types/strs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ where
620620
#[cfg(test)]
621621
mod tests {
622622
use super::*;
623+
use crate::{cstr16, cstr8};
623624
use alloc::string::String;
624-
use uefi_macros::{cstr16, cstr8};
625625

626626
// Tests if our CStr8 type can be constructed from a valid core::ffi::CStr
627627
#[test]

uefi/src/fs/dir_entry_iter.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
//! Module for directory iteration. See [`UefiDirectoryIter`].
22
33
use super::*;
4-
use crate::{CStr16, Result};
4+
use crate::{cstr16, CStr16, Result};
55
use alloc::boxed::Box;
6-
use uefi_macros::cstr16;
76

87
/// Common skip dirs in UEFI/FAT-style file systems.
98
pub const COMMON_SKIP_DIRS: &[&CStr16] = &[cstr16!("."), cstr16!("..")];

uefi/src/fs/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
//! There is no automatic synchronization of the file system for concurrent
4848
//! accesses. This is in the responsibility of the user.
4949
//!
50-
//! [`cstr16!`]: uefi_macros::cstr16
50+
//! [`cstr16!`]: crate::cstr16
5151
5252
mod dir_entry_iter;
5353
mod file_system;

uefi/src/fs/path/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@ pub use path::{Components, Path};
2121
pub use pathbuf::PathBuf;
2222

2323
use crate::data_types::chars::NUL_16;
24-
use crate::{CStr16, Char16};
24+
use crate::{cstr16, CStr16, Char16};
2525
pub(super) use validation::validate_path;
2626
pub use validation::PathError;
2727

2828
/// The default separator for paths.
2929
pub const SEPARATOR: Char16 = unsafe { Char16::from_u16_unchecked('\\' as u16) };
3030

3131
/// Stringified version of [`SEPARATOR`].
32-
pub const SEPARATOR_STR: &CStr16 = uefi_macros::cstr16!("\\");
32+
pub const SEPARATOR_STR: &CStr16 = cstr16!("\\");
3333

3434
/// Deny list of characters for path components. UEFI supports FAT-like file
3535
/// systems. According to <https://en.wikipedia.org/wiki/Comparison_of_file_systems>,

uefi/src/fs/path/path.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -198,8 +198,8 @@ mod convenience_impls {
198198
#[cfg(test)]
199199
mod tests {
200200
use super::*;
201+
use crate::cstr16;
201202
use alloc::vec::Vec;
202-
use uefi_macros::cstr16;
203203

204204
#[test]
205205
fn from_cstr16() {

uefi/src/fs/path/pathbuf.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,8 @@ mod convenience_impls {
120120
#[cfg(test)]
121121
mod tests {
122122
use super::*;
123+
use crate::cstr16;
123124
use alloc::string::ToString;
124-
use uefi_macros::cstr16;
125125

126126
#[test]
127127
fn from_cstr16() {

uefi/src/fs/path/validation.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,8 +67,7 @@ pub fn validate_path<P: AsRef<Path>>(path: P) -> Result<(), PathError> {
6767
mod tests {
6868
use super::*;
6969
use crate::fs::PathBuf;
70-
use crate::CString16;
71-
use uefi_macros::cstr16;
70+
use crate::{cstr16, CString16};
7271

7372
#[test]
7473
fn test_validate_path() {

uefi/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ mod util;
139139
// Crates that create procedural macros can't unit test the macros they export.
140140
// Therefore, we do some tests here.
141141
mod macro_tests {
142-
use uefi_macros::{cstr16, cstr8};
142+
use crate::{cstr16, cstr8};
143143

144144
#[test]
145145
fn cstr8_macro_literal() {

uefi/src/prelude.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
//!
33
//! This includes the system table types, `Status` codes, etc.
44
5-
pub use crate::{Handle, ResultExt, Status, StatusExt};
5+
pub use crate::{cstr16, cstr8, entry, Handle, ResultExt, Status, StatusExt};
66

77
// Import the basic table types.
88
pub use crate::table::boot::BootServices;
99
pub use crate::table::runtime::RuntimeServices;
1010
pub use crate::table::{Boot, SystemTable};
11-
12-
// Import the macro for creating the custom entry point, as well as the cstr macros.
13-
pub use uefi_macros::{cstr16, cstr8, entry};

uefi/src/proto/network/snp.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
1010
use super::{IpAddress, MacAddress};
1111
use crate::data_types::Event;
12+
use crate::proto::unsafe_protocol;
1213
use crate::{Result, Status, StatusExt};
1314
use bitflags::bitflags;
1415
use core::ffi::c_void;
1516
use core::ptr;
1617
use core::ptr::NonNull;
17-
use uefi_macros::unsafe_protocol;
1818

1919
/// The Simple Network Protocol
2020
#[derive(Debug)]

uefi/src/table/boot.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -95,9 +95,9 @@ impl BootServices {
9595
/// Update the global image [`Handle`].
9696
///
9797
/// This is called automatically in the `main` entry point as part
98-
/// of [`uefi_macros::entry`]. It should not be called at any other
98+
/// of [`uefi::entry`]. It should not be called at any other
9999
/// point in time, unless the executable does not use
100-
/// [`uefi_macros::entry`], in which case it should be called once
100+
/// [`uefi::entry`], in which case it should be called once
101101
/// before calling other `BootServices` functions.
102102
///
103103
/// # Safety

0 commit comments

Comments
 (0)