Format code

This commit is contained in:
Piotr Siuszko 2021-09-26 21:18:38 +02:00
parent 172c967095
commit 51351e054a
4 changed files with 5 additions and 8 deletions

View File

@ -11,9 +11,9 @@ use x86_64::instructions::hlt;
mod color; mod color;
mod serial; mod serial;
mod vga_buffer;
mod testable; mod testable;
mod utils; mod utils;
mod vga_buffer;
#[cfg(test)] #[cfg(test)]
fn test_runner(tests: &[&dyn Fn()]) { fn test_runner(tests: &[&dyn Fn()]) {
@ -30,7 +30,6 @@ fn trivial_assertion() {
assert_eq!(1, 1); assert_eq!(1, 1);
} }
#[cfg(not(test))] #[cfg(not(test))]
#[panic_handler] #[panic_handler]
fn panic(info: &PanicInfo) -> ! { fn panic(info: &PanicInfo) -> ! {

View File

@ -1,4 +1,4 @@
use crate::{serial_print,serial_println}; use crate::{serial_print, serial_println};
pub trait Testable { pub trait Testable {
fn run(&self) -> (); fn run(&self) -> ();
@ -13,4 +13,4 @@ where
self(); self();
serial_println!("[ok]"); serial_println!("[ok]");
} }
} }

View File

@ -17,7 +17,6 @@ pub fn exit_qemu(exit_code: QemuExitCode) {
} }
pub fn print_logo() { pub fn print_logo() {
let text = r###" let text = r###"
_ _ __ _ _ __
_ |_ |_) _ _|_/ \(_ _ |_ |_) _ _|_/ \(_
@ -26,4 +25,4 @@ pub fn print_logo() {
crate::vga_buffer::change_color(crate::color::Color::BrightRed); crate::vga_buffer::change_color(crate::color::Color::BrightRed);
println!("{}", text); println!("{}", text);
crate::vga_buffer::reset_color(); crate::vga_buffer::reset_color();
} }

View File

@ -100,8 +100,7 @@ impl fmt::Write for Writer {
} }
} }
pub fn change_color(color: Color) {
pub fn change_color(color : Color) {
WRITER.lock().color_code = ColorCode::new(color, Color::Black); WRITER.lock().color_code = ColorCode::new(color, Color::Black);
} }
pub fn reset_color() { pub fn reset_color() {