From ab988326ba79cdc2007d2e7cd31e406fbf691592 Mon Sep 17 00:00:00 2001 From: Christine Dodrill Date: Thu, 26 Mar 2020 11:06:17 -0400 Subject: [PATCH] rustfmt --- src/allocator.rs | 5 ++--- src/allocator/fixed_size_block.rs | 5 ++++- src/clock.rs | 12 ++++++------ src/main.rs | 4 ++-- 4 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/allocator.rs b/src/allocator.rs index 91e6bc7..8ed50cb 100644 --- a/src/allocator.rs +++ b/src/allocator.rs @@ -10,14 +10,13 @@ use x86_64::{ }; pub mod bump; -pub mod linked_list; pub mod fixed_size_block; +pub mod linked_list; use fixed_size_block::FixedSizeBlockAllocator; #[global_allocator] -static ALLOCATOR: Locked = Locked::new( - FixedSizeBlockAllocator::new()); +static ALLOCATOR: Locked = Locked::new(FixedSizeBlockAllocator::new()); pub struct Dummy; diff --git a/src/allocator/fixed_size_block.rs b/src/allocator/fixed_size_block.rs index 541b9c8..9291b3a 100644 --- a/src/allocator/fixed_size_block.rs +++ b/src/allocator/fixed_size_block.rs @@ -1,6 +1,9 @@ use super::Locked; use alloc::alloc::{GlobalAlloc, Layout}; -use core::{mem, ptr::{self, NonNull}}; +use core::{ + mem, + ptr::{self, NonNull}, +}; struct ListNode { next: Option<&'static mut ListNode>, diff --git a/src/clock.rs b/src/clock.rs index 3ce86b9..3fd690f 100644 --- a/src/clock.rs +++ b/src/clock.rs @@ -20,15 +20,15 @@ pub fn current_time() -> DateTime { } #[cfg(test)] -use crate::{serial_print, serial_println, println}; +use crate::{println, serial_print, serial_println}; #[test_case] fn test_current_time() { - serial_print!("current time... "); - let now = current_time(); - println!("{:?}", now); + serial_print!("current time... "); + let now = current_time(); + println!("{:?}", now); - assert_ne!(now.month(), 0); + assert_ne!(now.month(), 0); - serial_println!("[ok]"); + serial_println!("[ok]"); } diff --git a/src/main.rs b/src/main.rs index 3b57f10..9f45d99 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,9 +6,9 @@ extern crate alloc; +use alloc::string::ToString; use bootloader::{entry_point, BootInfo}; use core::panic::PanicInfo; -use alloc::string::ToString; use xe_os::{clock, init, println, wasm}; entry_point!(kernel_main); @@ -27,7 +27,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! { wasm::run(); println!("[ ] success"); - + xe_os::hlt_loop(); }