From 2ce5e52166a0f91bc7ff22c7ee9cdd2fdea6900b Mon Sep 17 00:00:00 2001 From: Yifan Wu Date: Sun, 21 Jan 2024 15:36:05 +0800 Subject: [PATCH] codecheck: Fix warnings --- os/src/fs/mod.rs | 4 ++-- os/src/mm/mod.rs | 2 +- user/src/bin/adder_atomic.rs | 2 +- user/src/bin/eisenberg.rs | 5 ++++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/os/src/fs/mod.rs b/os/src/fs/mod.rs index 8ae0418c5..cbde739d6 100644 --- a/os/src/fs/mod.rs +++ b/os/src/fs/mod.rs @@ -11,6 +11,6 @@ pub trait File: Send + Sync { fn write(&self, buf: UserBuffer) -> usize; } -pub use inode::{list_apps, open_file, OSInode, OpenFlags}; -pub use pipe::{make_pipe, Pipe}; +pub use inode::{list_apps, open_file, OpenFlags}; +pub use pipe::make_pipe; pub use stdio::{Stdin, Stdout}; diff --git a/os/src/mm/mod.rs b/os/src/mm/mod.rs index 34220c4a1..d63c27d8a 100644 --- a/os/src/mm/mod.rs +++ b/os/src/mm/mod.rs @@ -12,7 +12,7 @@ pub use memory_set::{kernel_token, MapPermission, MemorySet, KERNEL_SPACE}; use page_table::PTEFlags; pub use page_table::{ translated_byte_buffer, translated_ref, translated_refmut, translated_str, PageTable, - PageTableEntry, UserBuffer, UserBufferIterator, + PageTableEntry, UserBuffer, }; pub fn init() { diff --git a/user/src/bin/adder_atomic.rs b/user/src/bin/adder_atomic.rs index 00dd15324..5e216c6c9 100644 --- a/user/src/bin/adder_atomic.rs +++ b/user/src/bin/adder_atomic.rs @@ -6,8 +6,8 @@ extern crate user_lib; extern crate alloc; use alloc::vec::Vec; -use core::sync::atomic::{AtomicBool, Ordering}; use core::ptr::addr_of_mut; +use core::sync::atomic::{AtomicBool, Ordering}; use user_lib::{exit, get_time, thread_create, waittid, yield_}; static mut A: usize = 0; diff --git a/user/src/bin/eisenberg.rs b/user/src/bin/eisenberg.rs index e5355b96d..b16d3a7d6 100644 --- a/user/src/bin/eisenberg.rs +++ b/user/src/bin/eisenberg.rs @@ -7,7 +7,10 @@ extern crate alloc; extern crate core; use alloc::vec::Vec; -use core::{ptr::{addr_of, addr_of_mut, read_volatile, write_volatile}, sync::atomic::{AtomicUsize, Ordering}}; +use core::{ + ptr::{addr_of, addr_of_mut, read_volatile, write_volatile}, + sync::atomic::{AtomicUsize, Ordering}, +}; use user_lib::{exit, sleep, thread_create, waittid}; const N: usize = 2;