Run cargo fmt

This commit is contained in:
Greg Shuflin 2022-02-19 01:00:56 -08:00
parent 5c0ea91e65
commit 1cfd133cb2
2 changed files with 82 additions and 89 deletions

View File

@ -17,5 +17,3 @@ pub extern "C" fn _start() -> ! {
println!("Gamarjoba, munde!"); println!("Gamarjoba, munde!");
loop {} loop {}
} }

View File

@ -1,7 +1,6 @@
use core::fmt; use core::fmt;
use spin::Mutex;
use lazy_static::lazy_static; use lazy_static::lazy_static;
use spin::Mutex;
#[macro_export] #[macro_export]
macro_rules! print { macro_rules! print {
@ -48,7 +47,6 @@ pub enum Color {
White = 15, White = 15,
} }
#[derive(Debug, Clone, Copy, PartialEq, Eq)] #[derive(Debug, Clone, Copy, PartialEq, Eq)]
#[repr(transparent)] #[repr(transparent)]
pub struct ColorCode(u8); pub struct ColorCode(u8);
@ -87,7 +85,6 @@ impl Writer {
color_code, color_code,
buffer: unsafe { &mut *(0xb8000 as *mut Buffer) }, buffer: unsafe { &mut *(0xb8000 as *mut Buffer) },
} }
} }
pub fn write_string(&mut self, s: &str) { pub fn write_string(&mut self, s: &str) {
for byte in s.bytes() { for byte in s.bytes() {
@ -111,7 +108,8 @@ impl Writer {
let ptr = &mut self.buffer.chars[row][col] as *mut ScreenChar; let ptr = &mut self.buffer.chars[row][col] as *mut ScreenChar;
let screenchar = ScreenChar { let screenchar = ScreenChar {
ascii_char: byte, color_code, ascii_char: byte,
color_code,
}; };
unsafe { unsafe {
@ -161,10 +159,7 @@ impl fmt::Write for Writer {
} }
} }
lazy_static! { lazy_static! {
pub static ref WRITER: Mutex<Writer> = Mutex::new(Writer::new( pub static ref WRITER: Mutex<Writer> =
ColorCode::new(Color::Yellow, Color::Black) Mutex::new(Writer::new(ColorCode::new(Color::Yellow, Color::Black)));
));
} }