From eab6ddeb8d0fde3d0f152e49de5c12257459aa2e Mon Sep 17 00:00:00 2001 From: Julien CLEMENT Date: Fri, 3 Dec 2021 01:11:28 +0100 Subject: [PATCH] fix(coding style) Signed-off-by: Julien CLEMENT --- src/lib.rs | 7 +++---- src/serial.rs | 12 +++++++----- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a8e4050..4d4f55b 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,8 +1,8 @@ #![no_std] #![no_main] -mod vga; mod serial; +mod vga; use core::panic::PanicInfo; use vga::Color; @@ -15,8 +15,7 @@ fn panic_handler(info: &PanicInfo) -> ! { #[no_mangle] pub extern "C" fn julios_main() -> ! { - println!("Hello World!"); - println!("{}", "***JuliOS***"); - serial_println!("Test serial"); + println!("***JuliOS***"); + serial_println!("Hello serial"); panic!("Kernel end of flow"); } diff --git a/src/serial.rs b/src/serial.rs index cd9d7c3..68dc509 100644 --- a/src/serial.rs +++ b/src/serial.rs @@ -1,6 +1,6 @@ use core::fmt; -use spin::Mutex; use lazy_static::lazy_static; +use spin::Mutex; use x86_64::instructions::port::Port; const COM1: u16 = 0x3f8; @@ -22,7 +22,10 @@ lazy_static! { #[doc(hidden)] pub fn _print(args: ::core::fmt::Arguments) { use core::fmt::Write; - SERIAL1.lock().write_fmt(args).expect("Printing to serial failed"); + SERIAL1 + .lock() + .write_fmt(args) + .expect("Printing to serial failed"); } /// Prints to the host through the serial interface. @@ -49,7 +52,7 @@ pub struct SerialPort { impl SerialPort { pub fn new(port: u16) -> SerialPort { SerialPort { - base: Port::new(port) + base: Port::new(port), } } @@ -65,8 +68,7 @@ impl SerialPort { } } - fn init(&mut self) { - } + fn init(&mut self) {} } impl fmt::Write for SerialPort {