Run rustfmt

This commit is contained in:
Philipp Oppermann
2018-06-12 19:26:17 +02:00
parent 8b5be6ebc0
commit 6529cbc674
5 changed files with 20 additions and 12 deletions

View File

@@ -7,9 +7,9 @@
#[macro_use]
extern crate blog_os;
use blog_os::exit_qemu;
#[cfg(not(test))]
use core::panic::PanicInfo;
use blog_os::exit_qemu;
/// This function is the entry point, since the linker looks for a function
/// named `_start_` by default.
@@ -18,11 +18,12 @@ use blog_os::exit_qemu;
pub extern "C" fn _start() -> ! {
serial_println!("ok");
unsafe { exit_qemu(); }
unsafe {
exit_qemu();
}
loop {}
}
/// This function is called on panic.
#[cfg(not(test))]
#[panic_implementation]
@@ -32,6 +33,8 @@ pub fn panic(info: &PanicInfo) -> ! {
serial_println!("{}", info);
unsafe { exit_qemu(); }
unsafe {
exit_qemu();
}
loop {}
}
}

View File

@@ -6,9 +6,9 @@
#[macro_use]
extern crate blog_os;
use blog_os::exit_qemu;
#[cfg(not(test))]
use core::panic::PanicInfo;
use blog_os::exit_qemu;
#[cfg(not(test))]
#[no_mangle]
@@ -22,6 +22,8 @@ pub extern "C" fn _start() -> ! {
pub fn panic(_info: &PanicInfo) -> ! {
serial_println!("ok");
unsafe { exit_qemu(); }
unsafe {
exit_qemu();
}
loop {}
}

View File

@@ -13,8 +13,8 @@ extern crate array_init;
#[cfg(test)]
extern crate std;
pub mod vga_buffer;
pub mod serial;
pub mod vga_buffer;
pub unsafe fn exit_qemu() {
use x86_64::instructions::port::Port;

View File

@@ -26,4 +26,4 @@ pub extern "C" fn _start() -> ! {
pub fn panic(info: &PanicInfo) -> ! {
println!("{}", info);
loop {}
}
}

View File

@@ -1,5 +1,5 @@
use uart_16550::SerialPort;
use spin::Mutex;
use uart_16550::SerialPort;
lazy_static! {
pub static ref SERIAL1: Mutex<SerialPort> = {
@@ -11,7 +11,10 @@ lazy_static! {
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.
@@ -28,4 +31,4 @@ macro_rules! serial_println {
() => (serial_print!("\n"));
($fmt:expr) => (serial_print!(concat!($fmt, "\n")));
($fmt:expr, $($arg:tt)*) => (serial_print!(concat!($fmt, "\n"), $($arg)*));
}
}