diff --git a/address/src/lib.rs b/address/src/lib.rs index 789d5ba..d92c555 100644 --- a/address/src/lib.rs +++ b/address/src/lib.rs @@ -1,19 +1,14 @@ //! Type-safe wrappers for different address kinds #![no_std] -#![feature( - step_trait, - const_fn_trait_bound, - const_trait_impl, - const_panic -)] +#![feature(step_trait, const_fn_trait_bound, const_trait_impl, const_panic)] #[cfg(test)] #[macro_use] extern crate std; -pub mod virt; #[deny(missing_docs)] pub mod phys; +pub mod virt; trait Address {} diff --git a/address/src/virt.rs b/address/src/virt.rs index 506674e..f6d006f 100644 --- a/address/src/virt.rs +++ b/address/src/virt.rs @@ -231,10 +231,7 @@ mod tests { #[test] fn test_trivial_convert() { let v0 = VirtualAddress::::from(0x8123usize); - assert_eq!( - PhysicalAddress::from(v0), - PhysicalAddress::from(0x123usize) - ); + assert_eq!(PhysicalAddress::from(v0), PhysicalAddress::from(0x123usize)); } #[test] diff --git a/kernel/src/arch/aarch64/boot/mod.rs b/kernel/src/arch/aarch64/boot/mod.rs index 28b1c1c..e1127cf 100644 --- a/kernel/src/arch/aarch64/boot/mod.rs +++ b/kernel/src/arch/aarch64/boot/mod.rs @@ -4,7 +4,7 @@ fn __aa64_bsp_main() { debugln!("Test"); use crate::arch::machine; - use crate::dev::{Device, timer::TimestampSource, serial::SerialDevice}; + use crate::dev::{serial::SerialDevice, timer::TimestampSource, Device}; unsafe { machine::console().lock().enable().unwrap(); diff --git a/kernel/src/arch/aarch64/mach_qemu/mod.rs b/kernel/src/arch/aarch64/mach_qemu/mod.rs index 1566857..b95de4a 100644 --- a/kernel/src/arch/aarch64/mach_qemu/mod.rs +++ b/kernel/src/arch/aarch64/mach_qemu/mod.rs @@ -1,8 +1,8 @@ //! QEMU virt machine +use crate::arch::aarch64::timer::GenericTimer; use crate::dev::serial::{pl011::Pl011, SerialDevice}; use crate::dev::timer::TimestampSource; -use crate::arch::aarch64::timer::GenericTimer; use crate::sync::Spin; const UART0_BASE: usize = 0x09000000; diff --git a/kernel/src/arch/mod.rs b/kernel/src/arch/mod.rs index 0fc1503..bfbd157 100644 --- a/kernel/src/arch/mod.rs +++ b/kernel/src/arch/mod.rs @@ -19,8 +19,8 @@ cfg_if! { } // TODO move to mod io -use core::ops::Deref; use core::marker::PhantomData; +use core::ops::Deref; /// Wrapper for setting up memory-mapped registers and IO pub struct MemoryIo { @@ -37,7 +37,7 @@ impl MemoryIo { pub const unsafe fn new(base: usize) -> Self { Self { base, - _pd: PhantomData + _pd: PhantomData, } } } diff --git a/kernel/src/debug.rs b/kernel/src/debug.rs index be9e597..a7d969d 100644 --- a/kernel/src/debug.rs +++ b/kernel/src/debug.rs @@ -41,5 +41,9 @@ pub fn _debug(args: fmt::Arguments) { use crate::arch::machine; use fmt::Write; - SerialOutput { inner: machine::console() }.write_fmt(args).ok(); + SerialOutput { + inner: machine::console(), + } + .write_fmt(args) + .ok(); } diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 4d2f06e..bcca466 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -9,7 +9,6 @@ )] #![no_std] #![no_main] - #![deny(missing_docs)] #[macro_use] diff --git a/kernel/src/sync.rs b/kernel/src/sync.rs index 88a50fa..ad80f4d 100644 --- a/kernel/src/sync.rs +++ b/kernel/src/sync.rs @@ -1,7 +1,7 @@ //! Synchronization facilities module -use core::ops::{Deref, DerefMut}; use core::cell::UnsafeCell; +use core::ops::{Deref, DerefMut}; /// Dummy lock implementation, does not do any locking. /// @@ -9,26 +9,30 @@ use core::cell::UnsafeCell; /// interrupts are enabled. #[repr(transparent)] pub struct NullLock { - value: UnsafeCell + value: UnsafeCell, } /// Dummy lock guard for [NullLock]. #[repr(transparent)] pub struct NullLockGuard<'a, T: ?Sized> { - value: &'a mut T + value: &'a mut T, } impl NullLock { /// Constructs a new instance of the lock, wrapping `value` #[inline(always)] pub const fn new(value: T) -> Self { - Self { value: UnsafeCell::new(value) } + Self { + value: UnsafeCell::new(value), + } } /// Returns [NullLockGuard] for this lock #[inline(always)] pub fn lock(&self) -> NullLockGuard { - NullLockGuard { value: unsafe { &mut *self.value.get() } } + NullLockGuard { + value: unsafe { &mut *self.value.get() }, + } } }