From 5cf388439607c641a92611b98858a89b14fc87ef Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Wed, 26 Jun 2019 16:59:38 +0200 Subject: [PATCH] Run cargo fmt --- src/main.rs | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 3ce0b620..5f2d1856 100644 --- a/src/main.rs +++ b/src/main.rs @@ -6,10 +6,10 @@ extern crate alloc; +use alloc::{boxed::Box, rc::Rc, vec, vec::Vec}; use blog_os::println; use bootloader::{entry_point, BootInfo}; use core::panic::PanicInfo; -use alloc::{boxed::Box, vec, vec::Vec, rc::Rc}; entry_point!(kernel_main); @@ -23,8 +23,7 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! { let mut mapper = unsafe { memory::init(boot_info.physical_memory_offset) }; let mut frame_allocator = unsafe { BootInfoFrameAllocator::init(&boot_info.memory_map) }; - allocator::init_heap(&mut mapper, &mut frame_allocator) - .expect("heap initialization failed"); + allocator::init_heap(&mut mapper, &mut frame_allocator).expect("heap initialization failed"); // allocate a number on the heap let heap_value = Box::new(41); @@ -40,9 +39,15 @@ fn kernel_main(boot_info: &'static BootInfo) -> ! { // create a reference counted vector -> will be deallocated when count reaches 0 let reference_counted = Rc::new(vec![1, 2, 3]); let cloned_reference = reference_counted.clone(); - println!("current reference count is {}", Rc::strong_count(&cloned_reference)); + println!( + "current reference count is {}", + Rc::strong_count(&cloned_reference) + ); core::mem::drop(reference_counted); - println!("reference count is {} now", Rc::strong_count(&cloned_reference)); + println!( + "reference count is {} now", + Rc::strong_count(&cloned_reference) + ); #[cfg(test)] test_main();