Fixed most of the clippy warnings/suggestions.

This commit is contained in:
2025-02-23 02:05:13 +00:00
parent e722874cee
commit c2c552ef25
5 changed files with 28 additions and 30 deletions
+5 -13
View File
@@ -5,13 +5,13 @@ extern crate alloc;
use core::arch::asm;
use lib_alloc::allocator::init_heap;
use limine::request::{RequestsEndMarker, RequestsStartMarker};
use limine::BaseRevision;
pub use lib_ascii::{print, print_log, println, println_log, WRITER};
pub use lib_serial::{serial_print, serial_println, serial_read};
use x86_64::structures::paging::Translate;
use x86_64::{PhysAddr, VirtAddr};
// use x86_64::structures::paging::Translate;
// use x86_64::PhysAddr;
use x86_64::VirtAddr;
mod arch;
@@ -23,14 +23,6 @@ mod arch;
#[link_section = ".requests"]
static BASE_REVISION: BaseRevision = BaseRevision::new();
/// Define the stand and end markers for Limine requests.
#[used]
#[link_section = ".requests_start_marker"]
static _START_MARKER: RequestsStartMarker = RequestsStartMarker::new();
#[used]
#[link_section = ".requests_end_marker"]
static _END_MARKER: RequestsEndMarker = RequestsEndMarker::new();
#[panic_handler]
fn rust_panic(_info: &core::panic::PanicInfo) -> ! {
println!("Kernel panic: {}", _info);
@@ -82,8 +74,8 @@ pub fn boot() -> Result<(), &'static str> {
println_log!("[Success]");
print_log!(" Initialising Heap... ");
if let Err(e) = init_heap(&mut l4_table, &mut frame_allocator) {
return Err("Failed to initialise heap");
if init_heap(&mut l4_table, &mut frame_allocator).is_err() {
return Err("Failed to initialise heap: error");
}
println_log!("[Success]");