From bab900d762de1066f02e3e40aa889f77ab98f7fa Mon Sep 17 00:00:00 2001 From: lemolatoon <63438515+lemolatoon@users.noreply.github.com> Date: Sun, 12 Nov 2023 02:55:25 +0900 Subject: [PATCH] Refactor with clippy --- kernel/src/lifegame.rs | 5 ++--- kernel/src/main.rs | 7 ++----- kernel/src/xhci.rs | 3 +-- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/kernel/src/lifegame.rs b/kernel/src/lifegame.rs index 2fa7d41..e628c6a 100644 --- a/kernel/src/lifegame.rs +++ b/kernel/src/lifegame.rs @@ -2,15 +2,14 @@ extern crate alloc; use core::sync::atomic::AtomicBool; use alloc::collections::VecDeque; -use alloc::sync::Arc; use alloc::vec::Vec; use kernel_lib::futures::yield_pending; -use kernel_lib::layer::{LayerManager, Position, Window}; +use kernel_lib::layer::{Position, Window}; use kernel_lib::mutex::Mutex; use kernel_lib::render::{RendererMut, Vector2D}; use kernel_lib::Color; -use crate::graphics::{get_pixcel_writer, LAYER_MANGER}; +use crate::graphics::LAYER_MANGER; pub static CLICKED_POSITION_QUEUE: Mutex> = Mutex::new(VecDeque::new()); diff --git a/kernel/src/main.rs b/kernel/src/main.rs index 2a14b5a..2e9671c 100644 --- a/kernel/src/main.rs +++ b/kernel/src/main.rs @@ -4,12 +4,11 @@ use core::{arch::asm, panic::PanicInfo}; pub extern crate alloc; -use alloc::sync::Arc; use common::types::KernelMainArg; use core::fmt::Write; use kernel::{ alloc::alloc::GlobalAllocator, - graphics::{init_graphics, init_logger, LAYER_MANGER}, + graphics::{init_graphics, init_logger}, interrupts::init_idt, memory::MemoryMapper, multitasking::{ @@ -23,9 +22,7 @@ use kernel::{ }, xhci::init_xhci_controller, }; -use kernel_lib::{ - layer::LayerManager, mutex::Mutex, render::Vector2D, shapes::mouse::MOUSE_CURSOR_SHAPE, Color, -}; +use kernel_lib::{render::Vector2D, shapes::mouse::MOUSE_CURSOR_SHAPE, Color}; #[no_mangle] extern "C" fn kernel_main(arg: *const KernelMainArg) -> ! { diff --git a/kernel/src/xhci.rs b/kernel/src/xhci.rs index 2f3f83f..205f892 100644 --- a/kernel/src/xhci.rs +++ b/kernel/src/xhci.rs @@ -1,8 +1,7 @@ extern crate alloc; use core::ffi::c_void; -use alloc::sync::Arc; -use kernel_lib::{futures::yield_pending, layer::LayerManager, mutex::Mutex}; +use kernel_lib::futures::yield_pending; use crate::{ alloc::alloc::GlobalAllocator, interrupts::InterruptVector, memory::MemoryMapper, pci,