Skip to content

Commit ddb81bd

Browse files
authored
Merge pull request #1144 from nicholasbishop/bishop-cleanup-macros-imports
Minor import/export cleanups
2 parents 0c533bd + 826e559 commit ddb81bd

File tree

19 files changed

+38
-41
lines changed

19 files changed

+38
-41
lines changed

uefi/src/data_types/mod.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,23 +138,23 @@ pub trait Align {
138138
}
139139

140140
mod guid;
141-
pub use self::guid::{Guid, Identify};
141+
pub use guid::{Guid, Identify};
142142

143143
pub mod chars;
144-
pub use self::chars::{Char16, Char8};
144+
pub use chars::{Char16, Char8};
145145

146146
#[macro_use]
147147
mod opaque;
148148

149149
mod strs;
150-
pub use self::strs::{
150+
pub use strs::{
151151
CStr16, CStr8, EqStrUntilNul, FromSliceWithNulError, FromStrWithBufError, UnalignedCStr16Error,
152152
};
153153

154154
#[cfg(feature = "alloc")]
155155
mod owned_strs;
156156
#[cfg(feature = "alloc")]
157-
pub use self::owned_strs::{CString16, FromStrError};
157+
pub use owned_strs::{CString16, FromStrError};
158158

159159
mod unaligned_slice;
160160
pub use unaligned_slice::UnalignedSlice;

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/helpers/mod.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ pub fn init(st: &mut SystemTable<Boot>) -> Result<()> {
9292

9393
#[cfg(feature = "global_allocator")]
9494
unsafe {
95-
uefi::allocator::init(st);
95+
crate::allocator::init(st);
9696
}
9797

9898
Ok(())
@@ -111,5 +111,5 @@ pub(crate) fn exit() {
111111
logger::disable();
112112

113113
#[cfg(feature = "global_allocator")]
114-
uefi::allocator::exit_boot_services();
114+
crate::allocator::exit_boot_services();
115115
}

uefi/src/helpers/panic_handler.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,9 @@ fn panic_handler(info: &core::panic::PanicInfo) -> ! {
2929
} else {
3030
// If the system table is available, use UEFI's standard shutdown mechanism
3131
if let Some(st) = system_table_opt() {
32-
use uefi::table::runtime::ResetType;
32+
use crate::table::runtime::ResetType;
3333
st.runtime_services()
34-
.reset(ResetType::SHUTDOWN, uefi::Status::ABORTED, None);
34+
.reset(ResetType::SHUTDOWN, crate::Status::ABORTED, None);
3535
}
3636

3737
// If we don't have any shutdown mechanism handy, the best we can do is loop

0 commit comments

Comments
 (0)