diff --git a/tests/basic_boot.rs b/tests/basic_boot.rs index eb4a25ed..f5cf85e5 100644 --- a/tests/basic_boot.rs +++ b/tests/basic_boot.rs @@ -4,8 +4,8 @@ #![test_runner(blog_os::test_runner)] #![reexport_test_harness_main = "test_main"] -use core::panic::PanicInfo; use blog_os::{println, serial_print, serial_println}; +use core::panic::PanicInfo; #[no_mangle] // don't mangle the name of this function pub extern "C" fn _start() -> ! { diff --git a/tests/panic_handler.rs b/tests/panic_handler.rs index c15df7d3..0e1e6819 100644 --- a/tests/panic_handler.rs +++ b/tests/panic_handler.rs @@ -2,8 +2,11 @@ #![no_main] #![feature(panic_info_message)] -use core::{fmt::{self, Write}, panic::PanicInfo}; -use blog_os::{serial_print, serial_println, QemuExitCode, exit_qemu}; +use blog_os::{exit_qemu, serial_print, serial_println, QemuExitCode}; +use core::{ + fmt::{self, Write}, + panic::PanicInfo, +}; const MESSAGE: &str = "Example panic message from panic_handler test"; const PANIC_LINE: u32 = 14; // adjust this when moving the `panic!` call @@ -11,11 +14,11 @@ const PANIC_LINE: u32 = 14; // adjust this when moving the `panic!` call #[no_mangle] pub extern "C" fn _start() -> ! { serial_print!("panic_handler... "); - panic!(MESSAGE); // must be in line `PANIC_LINE` + panic!(MESSAGE); // must be in line `PANIC_LINE` } #[panic_handler] -fn panic(info: &PanicInfo) -> ! { +fn panic(info: &PanicInfo) -> ! { check_location(info); check_message(info); @@ -51,7 +54,7 @@ fn check_message(info: &PanicInfo) { } /// Compares a `fmt::Arguments` instance with the `MESSAGE` string -/// +/// /// To use this type, write the `fmt::Arguments` instance to it using the /// `write` macro. If a message component matches `MESSAGE`, the equals /// field is set to true. @@ -66,4 +69,4 @@ impl fmt::Write for CompareMessage { } Ok(()) } -} \ No newline at end of file +}