Skip to content

Commit 7cbc1ff

Browse files
committed
uefi: cleanup use and mod statements in data_types
Clean up the mess and follow our convention: - pub mod - mod - pub use - use
1 parent 47095b1 commit 7cbc1ff

1 file changed

Lines changed: 26 additions & 31 deletions

File tree

uefi/src/data_types/mod.rs

Lines changed: 26 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,32 @@
44
//!
55
//! This module defines the basic data types that are used throughout uefi-rs
66
7+
pub mod chars;
8+
9+
mod guid;
10+
#[macro_use]
11+
mod opaque;
12+
#[cfg(feature = "alloc")]
13+
mod owned_strs;
14+
mod strs;
15+
mod unaligned_slice;
16+
17+
pub use chars::{Char8, Char16};
18+
pub use guid::{Guid, Identify};
19+
#[cfg(feature = "alloc")]
20+
pub use owned_strs::{CString16, FromStrError};
21+
pub use strs::{
22+
CStr8, CStr16, EqStrUntilNul, FromSliceWithNulError, FromStrWithBufError, PoolString,
23+
UnalignedCStr16Error,
24+
};
25+
/// These functions are used in the implementation of the [`cstr8!`] macro.
26+
///
27+
/// [`cstr8!`]: crate::cstr8
28+
#[doc(hidden)]
29+
pub use strs::{str_num_latin1_chars, str_to_latin1};
30+
pub use uefi_raw::{PhysicalAddress, VirtualAddress};
31+
pub use unaligned_slice::UnalignedSlice;
32+
733
use core::ffi::c_void;
834
use core::ptr::{self, NonNull};
935

@@ -154,37 +180,6 @@ impl Align for [u8] {
154180
}
155181
}
156182

157-
mod guid;
158-
pub use guid::{Guid, Identify};
159-
160-
pub mod chars;
161-
pub use chars::{Char8, Char16};
162-
163-
#[macro_use]
164-
mod opaque;
165-
166-
mod strs;
167-
pub use strs::{
168-
CStr8, CStr16, EqStrUntilNul, FromSliceWithNulError, FromStrWithBufError, PoolString,
169-
UnalignedCStr16Error,
170-
};
171-
172-
/// These functions are used in the implementation of the [`cstr8!`] macro.
173-
///
174-
/// [`cstr8!`]: crate::cstr8
175-
#[doc(hidden)]
176-
pub use strs::{str_num_latin1_chars, str_to_latin1};
177-
178-
#[cfg(feature = "alloc")]
179-
mod owned_strs;
180-
#[cfg(feature = "alloc")]
181-
pub use owned_strs::{CString16, FromStrError};
182-
183-
mod unaligned_slice;
184-
pub use unaligned_slice::UnalignedSlice;
185-
186-
pub use uefi_raw::{PhysicalAddress, VirtualAddress};
187-
188183
#[cfg(test)]
189184
mod tests {
190185
use super::*;

0 commit comments

Comments
 (0)