Fix clippy errors
This commit is contained in:
@@ -40,7 +40,7 @@ pub enum InterruptIndex {
|
||||
}
|
||||
|
||||
impl InterruptIndex {
|
||||
fn as_u8(self) -> u8 {
|
||||
const fn as_u8(self) -> u8 {
|
||||
self as u8
|
||||
}
|
||||
|
||||
|
||||
@@ -48,9 +48,8 @@ pub static _KERNEL_PHYSICAL_MEMORY_OFFSET: Lazy<(u64, u64)> = Lazy::new(|| {
|
||||
///
|
||||
/// Panics if the memory map was not found in MEMORY_MAP_REQUEST.
|
||||
pub fn get_memory_map() -> &'static MemoryMapResponse {
|
||||
if let Some(memory_map) = MEMORY_MAP_REQUEST.get_response() {
|
||||
memory_map
|
||||
} else {
|
||||
unreachable!("Could not fetch memory map from Limine.")
|
||||
}
|
||||
MEMORY_MAP_REQUEST.get_response().map_or_else(
|
||||
|| unreachable!("Could not fetch memory map from Limine."),
|
||||
|memory_map| memory_map,
|
||||
)
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ pub unsafe fn init(physical_memory_offset: VirtAddr) -> OffsetPageTable<'static>
|
||||
}
|
||||
}
|
||||
|
||||
pub(crate) struct FoundryOSFrameAllocator {
|
||||
pub struct FoundryOSFrameAllocator {
|
||||
memory_map: &'static MemoryMapResponse,
|
||||
next: usize,
|
||||
}
|
||||
@@ -66,8 +66,8 @@ impl FoundryOSFrameAllocator {
|
||||
/// This function takes a reference to a `MemoryMapResponse` and initializes a
|
||||
/// `FoundryOSFrameAllocator` with it. The `next` field is set to 0, indicating that
|
||||
/// the first frame to be allocated is the first frame in the memory map.
|
||||
pub unsafe fn init(memory_map: &'static MemoryMapResponse) -> FoundryOSFrameAllocator {
|
||||
FoundryOSFrameAllocator {
|
||||
pub const unsafe fn init(memory_map: &'static MemoryMapResponse) -> Self {
|
||||
Self {
|
||||
memory_map,
|
||||
next: 0,
|
||||
}
|
||||
|
||||
@@ -4,4 +4,4 @@ pub mod interrupts;
|
||||
|
||||
pub mod memory;
|
||||
|
||||
pub(crate) mod memmap;
|
||||
pub mod memmap;
|
||||
|
||||
Reference in New Issue
Block a user